public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Fix regexps in gdb.base/step-over-syscall.exp
@ 2023-07-26  9:53 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-07-26  9:53 UTC (permalink / raw)
  To: gdb-patches

When running test-case gdb.base/step-over-syscall.exp without glibc debuginfo
installed, I get:
...
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, 0x00007ffff7d4405e in vfork () from /lib64/libc.so.6^M
(gdb) PASS: gdb.base/step-over-syscall.exp: vfork: displaced=off: \
  continue to vfork (1st time)
...
but with glibc debuginfo installed I get instead:
...
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, 0x00007ffff7d4405e in __libc_vfork () at \
  ../sysdeps/unix/sysv/linux/x86_64/vfork.S:44^M
44      ENTRY (__vfork)^M
(gdb) FAIL: gdb.base/step-over-syscall.exp: vfork: displaced=off: \
  continue to vfork (1st time)
...

The FAIL is due to a mismatch with regexp:
...
  "Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*"
...
because it cannot match both ".* in " and the __libc_ prefix.

Fix this by using instead the regexp:
...
  "Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*"
...

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/step-over-syscall.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/step-over-syscall.exp b/gdb/testsuite/gdb.base/step-over-syscall.exp
index bc795f2423a..1f1e62296c6 100644
--- a/gdb/testsuite/gdb.base/step-over-syscall.exp
+++ b/gdb/testsuite/gdb.base/step-over-syscall.exp
@@ -127,13 +127,13 @@ proc setup { syscall } {
 
     gdb_test "break \*$syscall" "Breakpoint \[0-9\]* at .*"
 
-    gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+    gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \
 	"continue to $syscall (1st time)"
     # Hit the breakpoint on $syscall for the first time.  In this time,
     # we will let PLT resolution done, and the number single steps we will
     # do later will be reduced.
 
-    gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+    gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \
 	"continue to $syscall (2nd time)"
     # Hit the breakpoint on $syscall for the second time.  In this time,
     # the address of syscall insn and next insn of syscall are recorded.
@@ -264,7 +264,7 @@ proc step_over_syscall { syscall } {
 		return -1
 	    }
 
-	    gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+	    gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \
 		"continue to $syscall (3rd time)"
 
 	    # Hit the breakpoint on $syscall for the third time.  In this time, we'll set
@@ -332,7 +332,7 @@ proc break_cond_on_syscall { syscall follow_fork detach_on_fork } {
 	    return -1
 	}
 
-	gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \
+	gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \
 	    "continue to $syscall"
 	# Delete breakpoint syscall insns to avoid interference with other syscalls.
 	delete_breakpoints

base-commit: 477c9f2ba26ccd77016f2c97941fc8b35e332e35
-- 
2.35.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-26  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26  9:53 [pushed] [gdb/testsuite] Fix regexps in gdb.base/step-over-syscall.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).