From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.base/run-attach-while-running.exp
Date: Mon, 7 Jun 2021 15:46:47 +0200 [thread overview]
Message-ID: <20210607134646.GA14459@delia> (raw)
Hi,
With a testsuite setup modified to make expect wait a little bit longer for
gdb output (see PR27957), I reliably run into:
...
27 return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M
(gdb) ^M
Thread 2 "run-attach-whil" stopped.^M
0x00007f13c85a74c0 in __GI___nanosleep () at nanosleep.c:27^M
27 return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M
FAIL: gdb.base/run-attach-while-running.exp: threaded=1: \
run-or-attach=attach: non-stop=on: test: attach to process (timeout)
...
The problem is that we're trying to match the gdb_prompt using gdb_test which
uses '$gdb_prompt $'. The terminating '$' prevents the match.
Fix this by rewriting the gdb_test into a gdb_test_multiple and dropping the
'$'.
Tested on x86_64-linux.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Fix gdb.base/run-attach-while-running.exp
gdb/testsuite/ChangeLog:
2021-06-07 Tom de Vries <tdevries@suse.de>
PR testsuite/27908
* gdb.base/run-attach-while-running.exp (test): Don't match prompt
after attach using '$gdb_prompt $'.
---
gdb/testsuite/gdb.base/run-attach-while-running.exp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/run-attach-while-running.exp b/gdb/testsuite/gdb.base/run-attach-while-running.exp
index 7c16aa6f5c4..1cc754a87ee 100644
--- a/gdb/testsuite/gdb.base/run-attach-while-running.exp
+++ b/gdb/testsuite/gdb.base/run-attach-while-running.exp
@@ -33,6 +33,8 @@ unset binfile
# - run-or-attach: "run" or "attach"
proc_with_prefix test { non-stop threaded run-or-attach } {
+ global gdb_prompt
+
if { ${run-or-attach} == "attach" && ![can_spawn_for_attach] } {
unsupported "attach not supported"
return
@@ -91,7 +93,11 @@ proc_with_prefix test { non-stop threaded run-or-attach } {
set test_spawn_id [spawn_wait_for_attach $::binfile]
set test_pid [spawn_id_get_pid $test_spawn_id]
- gdb_test "attach $test_pid" "Attaching to program: .*" "attach to process"
+ gdb_test_multiple "attach $test_pid" "attach to process" {
+ -re "Attaching to program: .*$gdb_prompt " {
+ pass $gdb_test_name
+ }
+ }
gdb_exit
kill_wait_spawned_process $test_spawn_id
reply other threads:[~2021-06-07 13:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210607134646.GA14459@delia \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).