[gdb/symtab] Trust epilogue unwind info for unknown producer (-g0 case)
[binutils-gdb.git] / gdb / testsuite / gdb.base / unwind-on-each-insn-amd64-2.exp
1 # Copyright 2023 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. */
15
16 # Check that epilogue unwind info is used, even if no debug info is available.
17
18 require is_x86_64_m64_target
19
20 set srcfile_flags {debug}
21 set srcfile2_flags {nodebug}
22
23 if [info exists COMPILE] {
24 # Make sure that we use .eh_frame info, by generating it
25 # using -fasynchronous-unwind-tables.
26 if { [gdb_can_simple_compile fasynchronous-unwind-tables \
27 { void foo () { } } object -fasynchronous-unwind-tables] } {
28 lappend srcfile2_flags additional_flags=-fasynchronous-unwind-tables
29 } else {
30 unsupported "required: .eh_frame"
31 return
32 }
33 standard_testfile unwind-on-each-insn.c unwind-on-each-insn-foo.c
34 # When updating the .s file, use these flags to generate the file:
35 #lappend srcfile2_flags additional_flags=-save-temps
36 #lappend srcfile2_flags additional_flags=-dA
37 # and do the following:
38 # - copy it in place, run the test-case and verify that all tests pass.
39 # - confuse the amd64 epilogue unwinder by inserting the following
40 # in foo:
41 # nop
42 # + pushq $.L1
43 # + ret
44 # + .L1:
45 # + nop
46 # popq %rbp
47 # - verify that the test-case passes.
48 } else {
49 standard_testfile unwind-on-each-insn.c .s
50 }
51
52 source $srcdir/$subdir/unwind-on-each-insn.exp.tcl