Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 2/4] [gdb/testsuite] Fix regexps in gdb.base/corefile.exp
Date: Fri,  6 Nov 2026 13:58:27 +0100	[thread overview]
Message-ID: <20261106125829.1450659-3-tdevries@suse.de> (raw)
In-Reply-To: <20261106125829.1450659-1-tdevries@suse.de>

[ This commit assumes the situation before commit b32f06001cf ("Change
`...'-style quoting in gdb"). ]

In test-case gdb.base/corefile.exp, we find a regexp "\(\)".

Because double quotes are used, backslash substitution is done, getting us
'()', which is an empty regexp that matches anything.

Presumably, "\\(\\)" to match literal parentheses was meant, but that doesn't
match because I get:
...
tid=no_tid@entry=0) at pthread_kill.c:44^M
...

Fix this by using "\\(\[^\r\n\]*\\)".
---
 gdb/testsuite/gdb.base/corefile.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index 2e6beab9928..69ad042a572 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -60,10 +60,10 @@ proc start_gdb_with_corefile { testname coreopt corefile {binfile ""} } {
 	    -re -wrap "Couldn't find .* registers in core file.*" {
 		fail "$gdb_test_name (couldn't find regs)"
 	    }
-	    -re -wrap "Core was generated by `[string_to_regexp $::binfile]'\\.\r\n.*\#0  \[^\r\n\]+\(\).*" {
+	    -re -wrap "Core was generated by `[string_to_regexp $::binfile]'\\.\r\n.*\#0  \[^\r\n\]+\\(\[^\r\n\]*\\).*" {
 		pass $gdb_test_name
 	    }
-	    -re -wrap "Core was generated by .*\r\n\#0  .*\(\).*" {
+	    -re -wrap "Core was generated by .*\r\n\#0  .*\\(\[^\r\n\]*\\).*" {
 		# This case is hit when the executable name is
 		# truncated in the output.
 		pass "$gdb_test_name (with bad program name)"
@@ -117,10 +117,10 @@ gdb_test_multiple "core-file $corefile" "core-file command" {
 	send_gdb "y\n"
 	exp_continue
     }
-    -re "Core was generated by .*corefile.*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
+    -re "Core was generated by .*corefile.*\r\n\#0  .*\\(\[^\r\n\]*\\).*\r\n$gdb_prompt $" {
 	pass "core-file command"
     }
-    -re "Core was generated by .*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
+    -re "Core was generated by .*\r\n\#0  .*\\(\[^\r\n\]*\\).*\r\n$gdb_prompt $" {
 	pass "core-file command (with bad program name)"
     }
     -re ".*registers from core file: File in wrong format.* $" {
-- 
2.51.0


  parent reply	other threads:[~2026-11-06 13:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 12:58 [pushed 0/4] [gdb/testsuite] Handle updated quoting style in some test-cases Tom de Vries
2026-11-06 12:58 ` [pushed 1/4] [gdb/testsuite] Avoid "with bad program name" in gdb.base/corefile.exp Tom de Vries
2026-11-06 12:58 ` Tom de Vries [this message]
2026-11-06 13:45   ` [pushed 2/4] [gdb/testsuite] Fix regexps " Tom de Vries
2026-11-06 12:58 ` [pushed 3/4] [gdb/testsuite] Handle updated quoting style in some test-cases Tom de Vries
2026-11-06 12:58 ` [pushed 4/4] [gdb/ada] Fix error message in ada_funcall_operation::evaluate Tom de Vries
2026-11-06 14:33 ` [pushed 0/4] [gdb/testsuite] Handle updated quoting style in some test-cases Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261106125829.1450659-3-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox