diff options
author | Tom de Vries <tdevries@suse.de> | 2023-11-14 14:54:33 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-11-14 14:54:33 +0100 |
commit | 3f57217b8fc6e081edc09ce7c2cee3850345c012 (patch) | |
tree | 03465f97ea0e127b695413e6d6b1efdabe624edd /gdb | |
parent | 8f6c452b5a4e50fbb55ff1d13328b392ad1fd416 (diff) | |
download | gdb-3f57217b8fc6e081edc09ce7c2cee3850345c012.zip gdb-3f57217b8fc6e081edc09ce7c2cee3850345c012.tar.gz gdb-3f57217b8fc6e081edc09ce7c2cee3850345c012.tar.bz2 |
[gdb/testsuite] Fix gdb.threads/stepi-over-clone.exp regexp
I ran into the following FAIL:
...
(gdb) PASS: gdb.threads/stepi-over-clone.exp: catch process syscalls
continue^M
Continuing.^M
^M
Catchpoint 2 (call to syscall clone), clone () at \
../sysdeps/unix/sysv/linux/x86_64/clone.S:78^M
warning: 78 ../sysdeps/unix/sysv/linux/x86_64/clone.S: \
No such file or directory^M
(gdb) FAIL: gdb.threads/stepi-over-clone.exp: continue
...
All but one regexps in the .exp file use "clone\[23\]?" with "?" to
also accept "clone", except the failing case. This commit fixes that
case to also use "?".
Furthermore, there are FAILs like this:
...
(gdb) PASS: gdb.threads/stepi-over-clone.exp: third_thread=false: \
non-stop=on: displaced=off: i=0: continue
stepi^M
[New Thread 0x7ffff7ff8700 (LWP 15301)]^M
Hello from the first thread.^M
78 in ../sysdeps/unix/sysv/linux/x86_64/clone.S^M
(gdb) XXX: Consume the initial command
XXX: Consume new thread line
XXX: Consume first worker thread message
FAIL: gdb.threads/stepi-over-clone.exp: third_thread=false: non-stop=on: \
displaced=off: i=0: stepi
...
because this output is expected instead:
...
Hello from the first thread.^M
0x00000000004212cd in clone3 ()^M
...
The root cause for the difference is the presence of .debug_line info for
clone.
Fix this by updating the relevant regexps.
Tested on x86_64-linux, specifically:
- openSUSE Leap 15.4 (where the FAILs where observed), and
- openSUSE Tumbleweed (where the FAILs where not observed).
Co-Authored-By: Pedro Alves <pedro@palves.net>
Approved-By: Pedro Alves <pedro@palves.net>
Change-Id: I74ca9e7d4cfe6af294fd50e8c509fcbad289b78c
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/gdb.threads/stepi-over-clone.exp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.threads/stepi-over-clone.exp b/gdb/testsuite/gdb.threads/stepi-over-clone.exp index 4c49642..ea774d2 100644 --- a/gdb/testsuite/gdb.threads/stepi-over-clone.exp +++ b/gdb/testsuite/gdb.threads/stepi-over-clone.exp @@ -44,8 +44,12 @@ gdb_test_multiple "catch syscall group:process" "catch process syscalls" { } } +set re_loc1 "$hex in clone\[23\]? \\(\\)" +set re_loc2 "$decimal\[ \t\]+in \[^\r\n\]+" +set re_loc3 "clone\[23\]? \\(\\) at \[^:\]+:$decimal" + gdb_test "continue" \ - "Catchpoint $decimal \\(call to syscall clone\[23\]\\), .*" + "Catchpoint $decimal \\(call to syscall clone\[23\]?\\), ($re_loc1|$re_loc3).*" # Return true if INSN is a syscall instruction. @@ -201,7 +205,7 @@ proc test {non_stop displaced third_thread} { -i $::gdb_spawn_id - -re "^$hex in clone\[23\]? \\(\\)\r\n" { + -re "^($::re_loc1|$::re_loc2)\r\n" { verbose -log "XXX: Consume stop location line" set thread_1_stopped true if { !$seen_prompt } { @@ -240,7 +244,7 @@ proc test {non_stop displaced third_thread} { } } - -re "^Thread 2\[^\r\n\]+ hit Breakpoint $decimal, $hex in clone\[23\]? \\(\\)\r\n" { + -re "^Thread 2\[^\r\n\]+ hit Breakpoint $decimal, ($::re_loc1|$::re_loc3)\r\n" { verbose -log "XXX: Consume thread 2 hit breakpoint" set thread_2_stopped true if { !$seen_prompt } { @@ -277,7 +281,7 @@ proc test {non_stop displaced third_thread} { # always still be in clone. set match_code {} lappend match_code { - -re "\\*?\\s+1\\s+Thread\[^\r\n\]+clone\[23\]? \\(\\)\r\n" { + -re "\\*?\\s+1\\s+Thread\[^\r\n\]+($::re_loc1|$::re_loc3)\r\n" { incr thread_count exp_continue } @@ -291,7 +295,7 @@ proc test {non_stop displaced third_thread} { # be stopped at the breakpoint in clone (just before the # third thread is actually created). lappend match_code { - -re "\\*?\\s+2\\s+Thread\[^\r\n\]+$hex in clone\[23\]? \\(\\)\r\n" { + -re "\\*?\\s+2\\s+Thread\[^\r\n\]+($::re_loc1|$::re_loc3)\r\n" { incr thread_count exp_continue } |