diff options
author | Tom de Vries <tdevries@suse.de> | 2020-07-21 16:22:34 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-07-21 16:22:34 +0200 |
commit | 6d3d6e4ba779dc08b134cd1a09b055dbd88dbf8a (patch) | |
tree | e595df0265d7531255a0f0a127aef518ba410f40 /gdb/testsuite | |
parent | 803d0592abc57fe0f9c93ca33e9af6a6f698f23f (diff) | |
download | fsf-binutils-gdb-6d3d6e4ba779dc08b134cd1a09b055dbd88dbf8a.zip fsf-binutils-gdb-6d3d6e4ba779dc08b134cd1a09b055dbd88dbf8a.tar.gz fsf-binutils-gdb-6d3d6e4ba779dc08b134cd1a09b055dbd88dbf8a.tar.bz2 |
[gdb/testsuite] Fix gdb.reverse/solib-{precsave,reverse}.exp with gcc-8
With gcc-8, we have the following FAILs, which are not there for gcc-7:
...
FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function one
FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function one
FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main one
FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function two
FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function two
FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main two
FAIL: gdb.reverse/solib-precsave.exp: run until end part two
FAIL: gdb.reverse/solib-precsave.exp: reverse-next over solib function one
FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function one
FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function one
FAIL: gdb.reverse/solib-reverse.exp: reverse-step back to main one
FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function two
FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function two
FAIL: gdb.reverse/solib-reverse.exp: reverse-step back to main two
FAIL: gdb.reverse/solib-reverse.exp: run until end part two
FAIL: gdb.reverse/solib-reverse.exp: reverse-next over solib function one
...
Looking at the first FAIL for gdb.reverse/solib-precsave.exp, we have:
...
(gdb) PASS: reverse-next first shr1
reverse-next^M
40 b[0] = 6; b[1] = 9; /* generic statement, end part two */^M
(gdb) PASS: reverse-next generic
reverse-step^M
-shr2 (x=17) at gdb.reverse/shr2.c:23^M
-23 }^M
-(gdb) PASS: reverse-step into solib function one
+38 b[1] = shr2(17); /* middle part two */^M
+(gdb) FAIL: reverse-step into solib function one
...
There's a difference in line number info for line 38, where for gcc-7 we have:
...
Line number Starting address View Stmt
38 0x4005c6 x
...
and for gcc-8:
...
38 0x4005c1 x
38 0x4005cb x
...
which explains why we don't step directly into "solib function one".
Fix this by recognizing the extra "recommended breakpoint location" and
issuing an additional reverse-next/step.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-07-21 Tom de Vries <tdevries@suse.de>
* gdb.reverse/solib-precsave.exp: Handle additional "recommended
breakpoint locations".
* gdb.reverse/solib-reverse.exp: Same.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/solib-precsave.exp | 30 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/solib-reverse.exp | 30 |
3 files changed, 60 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b67ad73..804df02 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2020-07-21 Tom de Vries <tdevries@suse.de> + * gdb.reverse/solib-precsave.exp: Handle additional "recommended + breakpoint locations". + * gdb.reverse/solib-reverse.exp: Same. + +2020-07-21 Tom de Vries <tdevries@suse.de> + * gdb.reverse/step-reverse.c (callee): Merge statements. 2020-07-21 Tom de Vries <tdevries@suse.de> diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp index cd44007..8d57e79 100644 --- a/gdb/testsuite/gdb.reverse/solib-precsave.exp +++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp @@ -148,11 +148,27 @@ gdb_test "reverse-next" " generic statement.*" "reverse-next generic" # Test reverse-step into debuggable solib function # -gdb_test "reverse-step" "${lib2src}.*" "reverse-step into solib function one" +gdb_test_multiple "reverse-step" "reverse-step into solib function one" { + -re -wrap "middle part two.*" { + send_gdb "reverse-step\n" + exp_continue + } + -re -wrap "${lib2src}.*" { + pass $gdb_test_name + } +} gdb_test "reverse-step" "return 2.x.*" "reverse-step within solib function one" gdb_test "reverse-step" " middle part two.*" "reverse-step back to main one" -gdb_test "reverse-step" "${lib2src}.*" "reverse-step into solib function two" +gdb_test_multiple "reverse-step" "reverse-step into solib function two" { + -re -wrap "begin part two.*" { + send_gdb "reverse-step\n" + exp_continue + } + -re -wrap "${lib2src}.*" { + pass $gdb_test_name + } +} gdb_test "reverse-step" "return 2.x.*" "reverse-step within solib function two" gdb_test "reverse-step" " begin part two.*" "reverse-step back to main two" @@ -163,4 +179,12 @@ gdb_test "reverse-step" " begin part two.*" "reverse-step back to main two" gdb_test "until $end_part_two" " end part two.*" "run until end part two" gdb_test "reverse-next" " middle part two.*" "reverse-next over solib function one" -gdb_test "reverse-next" " begin part two.*" "reverse-next over solib function two" +gdb_test_multiple "reverse-next" "reverse-next over solib function two" { + -re -wrap "middle part two.*" { + send_gdb "reverse-next\n" + exp_continue + } + -re -wrap " begin part two.*" { + pass $gdb_test_name + } +} diff --git a/gdb/testsuite/gdb.reverse/solib-reverse.exp b/gdb/testsuite/gdb.reverse/solib-reverse.exp index 8ff62e2..843aedc 100644 --- a/gdb/testsuite/gdb.reverse/solib-reverse.exp +++ b/gdb/testsuite/gdb.reverse/solib-reverse.exp @@ -122,11 +122,27 @@ gdb_test "reverse-next" " generic statement.*" "reverse-next generic" # Test reverse-step into debuggable solib function # -gdb_test "reverse-step" "${lib2src}.*" "reverse-step into solib function one" +gdb_test_multiple "reverse-step" "reverse-step into solib function one" { + -re -wrap "middle part two.*" { + send_gdb "reverse-step\n" + exp_continue + } + -re -wrap "${lib2src}.*" { + pass $gdb_test_name + } +} gdb_test "reverse-step" "return 2.x.*" "reverse-step within solib function one" gdb_test "reverse-step" " middle part two.*" "reverse-step back to main one" -gdb_test "reverse-step" "${lib2src}.*" "reverse-step into solib function two" +gdb_test_multiple "reverse-step" "reverse-step into solib function two" { + -re -wrap "begin part two.*" { + send_gdb "reverse-step\n" + exp_continue + } + -re -wrap "${lib2src}.*" { + pass $gdb_test_name + } +} gdb_test "reverse-step" "return 2.x.*" "reverse-step within solib function two" gdb_test "reverse-step" " begin part two.*" "reverse-step back to main two" @@ -137,4 +153,12 @@ gdb_test "reverse-step" " begin part two.*" "reverse-step back to main two" gdb_test "until $end_part_two" " end part two.*" "run until end part two" gdb_test "reverse-next" " middle part two.*" "reverse-next over solib function one" -gdb_test "reverse-next" " begin part two.*" "reverse-next over solib function two" +gdb_test_multiple "reverse-next" "reverse-next over solib function two" { + -re -wrap "middle part two.*" { + send_gdb "reverse-next\n" + exp_continue + } + -re -wrap " begin part two.*" { + pass $gdb_test_name + } +} |