summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-04-13 14:29:00 +0200
committerTom de Vries <tdevries@suse.de>2022-04-13 14:29:00 +0200
commit4f538bcbb7b367c17e9c288fc506d650e1c8d7c8 (patch)
tree2211e8d85b0cb0f74a6fbc0183a585e4e2cc7a6c
parent1ab8f3967db3941fa2d78fe9c2d3a02bc15e30c4 (diff)
[gdb/testsuite] Fix gdb.dwarf2/dw2-lines.exp for m32 pie
As reported in PR29043, when running test-case gdb.dwarf2/dw2-lines.exp with target board unix/-m32/-fPIE/-pie, we run into: ... Breakpoint 2, 0x56555540 in bar ()^M (gdb) PASS: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: \ continue to breakpoint: foo \(1\) next^M Single stepping until exit from function bar,^M which has no line number information.^M 0x56555587 in main ()^M (gdb) FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: \ next to foo (2) ... The problem is that the bar breakpoint ends up at an unexpected location because: - the synthetic debug info is incomplete and doesn't provide line info for the prologue part of the function, so consequently gdb uses the i386 port prologue skipper to get past the prologue - the i386 port prologue skipper doesn't get past a get_pc_thunk call. Work around this in the test-case by breaking on bar_label instead. Tested on x86_64-linux with target boards unix, unix/-m32, unix/-fPIE/-pie and unix/-m32/-fPIE/-pie.
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-lines.exp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
index c1be18aa88..1fd7b76837 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
@@ -114,7 +114,7 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} {
return -1
}
- gdb_breakpoint "bar"
+ gdb_breakpoint "bar_label"
gdb_continue_to_breakpoint "foo \\(1\\)"
gdb_test "next" "foo \\(2\\).*" "next to foo (2)"