aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorGuinevere Larsen <blarsen@redhat.com>2023-07-21 13:45:12 +0200
committerGuinevere Larsen <blarsen@redhat.com>2023-08-24 11:08:35 +0200
commit890891f14de5f08a5e5bfa4a6907fb6ec409dd45 (patch)
tree437337a4bedf92a34a933c9d21bd05237fec3649 /gdb/testsuite/lib
parenta47dae3f3a6265576a876c9d6229c8e1e29d5636 (diff)
downloadbinutils-890891f14de5f08a5e5bfa4a6907fb6ec409dd45.zip
binutils-890891f14de5f08a5e5bfa4a6907fb6ec409dd45.tar.gz
binutils-890891f14de5f08a5e5bfa4a6907fb6ec409dd45.tar.bz2
gdb/testsuite: fix gdb.reverse/solib-*.exp tests when using clang
The tests gdb.reverse/solib-precsave.exp and solib-reverse.exp have the assumption that line tables will have an entry for the closing } in a function. Not all compiles do this, one example being clang. To fix this, this commit changes the function in shr2.c to have multiple lines, and the test to accept either line as a correct step location. To properly re-sync the inferiors, the function repeat_cmd_until had to be slightly changed to work with empty "current locations", so that we are able to step through multiple lines. This also changes the annotations used to determine the breakpoint locations in solib-reverse.c, adding a simple variable assignment right before the return statement. This way GDB will not set a breakpoint in the closing } line. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 36bf738..8432e63 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -9716,6 +9716,9 @@ proc repeat_cmd_until { command current target \
set count 0
gdb_test_multiple "$command" "$test_name" {
+ -re "$target.*$gdb_prompt $" {
+ pass "$test_name"
+ }
-re "$current.*$gdb_prompt $" {
incr count
if { $count < $max_steps } {
@@ -9725,9 +9728,6 @@ proc repeat_cmd_until { command current target \
fail "$test_name"
}
}
- -re "$target.*$gdb_prompt $" {
- pass "$test_name"
- }
}
}