diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2019-12-15 11:05:47 +0100 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2019-12-17 11:10:25 -0500 |
commit | 5024637fac653914d471808288dc3221bc7ec089 (patch) | |
tree | 7489cea0c61c4f02ee8218f432288cc00551ad97 /gdb | |
parent | b63634be6407273c2d014753fb0c0ca79ea5ab31 (diff) | |
download | gdb-5024637fac653914d471808288dc3221bc7ec089.zip gdb-5024637fac653914d471808288dc3221bc7ec089.tar.gz gdb-5024637fac653914d471808288dc3221bc7ec089.tar.bz2 |
Fix skip.exp test failure observed with gcc-9.2.0
We need to step a second time with this gcc version.
The first step jumps back to main before entering foo.
Previously the control flow was from bar directly to foo.
Further ananlysis suggests, that this change in behavior started
with gcc-8.1.0 when -gcolumn-info was enabled by default.
The option -gcolumn-info was first implemented in gcc-7.1.0 but
default-disabled, so you can get the altered behavior already with
gcc-7 if you manually enable -gcolumn-info.
Previously there was just one point where line 30 (of skip.c) started:
[0x00000032] Advance Line by 27 to 28
[0x00000034] Copy
[0x00000035] Special opcode 63: advance Address by 4 to 0x4004cb and Line by 2 to 30
[0x00000036] Advance PC by constant 17 to 0x4004dc
[0x00000037] Special opcode 7: advance Address by 0 to 0x4004dc and Line by 2 to 32
But with -gcolumn-info enabled, we have line 30 three times with different column:
[0x00000034] Advance Line by 27 to 28
[0x00000036] Copy
[0x00000037] Set column to 9
[0x00000039] Special opcode 63: advance Address by 4 to 0x4004c6 and Line by 2 to 30
[0x0000003a] Set column to 17
[0x0000003c] Special opcode 75: advance Address by 5 to 0x4004cb and Line by 0 to 30
[0x0000003d] Set column to 3
[0x0000003f] Special opcode 75: advance Address by 5 to 0x4004d0 and Line by 0 to 30
[0x00000040] Special opcode 105: advance Address by 7 to 0x4004d7 and Line by 2 to 32
That could probably be filtered in dwarf2read.c to keep the old behavior, but
the new behavior makes still sense, even if we cannot really make use of the
column in the line number info for now.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/skip.exp | 16 |
2 files changed, 15 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1f4f28d..01f6fdf 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2019-12-17 Bernd Edlinger <bernd.edlinger@hotmail.de> + * gdb.base/skip.exp: Fix test failure observed with gcc-9.2.0. + +2019-12-17 Bernd Edlinger <bernd.edlinger@hotmail.de> + * gdb.base/skip.exp: Whitespace fix. 2019-12-16 Bernd Edlinger <bernd.edlinger@hotmail.de> diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp index 6b74f51..d6994d5 100644 --- a/gdb/testsuite/gdb.base/skip.exp +++ b/gdb/testsuite/gdb.base/skip.exp @@ -141,9 +141,11 @@ with_test_prefix "step after disabling 3" { } gdb_test "step" "bar \\(\\) at.*" "step 1" - gdb_test "step" ".*" "step 2"; # Return from foo() - gdb_test "step" "foo \\(\\) at.*" "step 3" - gdb_test "step" ".*" "step 4"; # Return from bar() + gdb_test "step" ".*" "step 2"; # Return from bar() + # With gcc 9.2.0 we jump once back to main before entering foo here. + # If that happens try to step a second time. + gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at .*" "step" + gdb_test "step" ".*" "step 4"; # Return from foo() gdb_test "step" "main \\(\\) at.*" "step 5" } @@ -261,7 +263,9 @@ with_test_prefix "step using -fu for baz" { gdb_test_no_output "skip enable 7" gdb_test "step" "bar \\(\\) at.*" "step 1" gdb_test "step" ".*" "step 2"; # Return from bar() - gdb_test "step" "foo \\(\\) at.*" "step 3" + # With gcc 9.2.0 we jump once back to main before entering foo here. + # If that happens try to step a second time. + gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at.*" "step" gdb_test "step" ".*" "step 4"; # Return from foo() gdb_test "step" "main \\(\\) at.*" "step 5" } @@ -276,7 +280,9 @@ with_test_prefix "step using -rfu for baz" { gdb_test_no_output "skip enable 8" gdb_test "step" "bar \\(\\) at.*" "step 1" gdb_test "step" ".*" "step 2"; # Return from bar() - gdb_test "step" "foo \\(\\) at.*" "step 3" + # With gcc 9.2.0 we jump once back to main before entering foo here. + # If that happens try to step a second time. + gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at.*" "step" gdb_test "step" ".*" "step 4"; # Return from foo() gdb_test "step" "main \\(\\) at.*" "step 5" } |