[gdb/testsuite] Add gdb.base/unwind-on-each-insn-{amd64,i386}.exp
authorTom de Vries <tdevries@suse.de>
Thu, 26 Jan 2023 16:21:01 +0000 (17:21 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 26 Jan 2023 16:21:01 +0000 (17:21 +0100)
commit1d98e564c97f770bb39954b347c129aa8950dc3b
treed669e1179142b7223b18876052684154f9c9c092
parent4fe960e8f105c1c3c672a56f768bb65b2b8cc04e
[gdb/testsuite] Add gdb.base/unwind-on-each-insn-{amd64,i386}.exp

The gcc 4.4.x (and earlier) compilers had the problem that the unwind info in
the epilogue was inaccurate.

In order to work around this in gdb, epilogue unwinders were added with a
higher priority than the dwarf unwinders in the amd64 and i386 targets:
- amd64_epilogue_frame_unwind, and
- i386_epilogue_frame_unwind.

Subsequently, the epilogue unwind info problem got fixed in gcc 4.5.0.

However, the epilogue unwinders prevented gdb from taking advantage of the
fixed epilogue unwind info, so the scope of the epilogue unwinders was
limited, bailing out for gcc >= 4.5.0.

There was no regression test added for this preference scheme, so if we now
declare epilogue unwind info from all gcc versions as trusted, no test will
start failing.

Fix this by adding an amd64 and i386 regression test for this.

I have no gcc 4.4.x lying around, so I fabricated the assembly files by:
- commenting out some .cfi directives to break the epilogue unwind info, and
- hand-editing the producer info to 4.4.7 to activate the fix.

Tested on x86_64-linux, target boards unix/{-m64,-m32}.
gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp [new file with mode: 0644]
gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.s [new file with mode: 0644]
gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp [new file with mode: 0644]
gdb/testsuite/gdb.base/unwind-on-each-insn-i386.s [new file with mode: 0644]
gdb/testsuite/gdb.base/unwind-on-each-insn.exp
gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl [new file with mode: 0644]