Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simon.marchi@polymtl.ca>,
	Simon Marchi <simon.marchi@efficios.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH v2 3/3] gdb: introduce scoped debug prints
Date: Tue, 5 Jan 2021 10:23:34 +0100	[thread overview]
Message-ID: <66ff5e72-f002-ed4f-075a-3054d17e7862@suse.de> (raw)
In-Reply-To: <d32497b1-bd0e-cad1-0d4d-7b11b6718f6a@suse.de>

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

On 1/5/21 10:01 AM, Tom de Vries wrote:
> [ I first tried to override $gdb_prompt for the duration of
> gdb_test_sequence using save_vars, but there's the invariant that the
> gdb_prompt variable has an implicit " " after it, which
> gdb_test_sequence adds, so that didn't work. ]

So, if we introduce a variable gdb_prompt_full which does contain the
space, and use it in gdb_test_sequence, we can override it.

Thanks,
- Tom


[-- Attachment #2: tmp.patch --]
[-- Type: text/x-patch, Size: 2105 bytes --]

diff --git a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
index fe842531977..03f9c135361 100644
--- a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
+++ b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
@@ -102,12 +102,16 @@ gdb_test "set scheduler-locking off"
 gdb_test "set debug infrun 1"
 
 set test "step"
-gdb_test_sequence $test $test {
-    "need to step-over"
-    "resume_1: step=1,"
-    "signal arrived while stepping over breakpoint"
-    "stepped to a different line"
-    "callme"
+save_vars { gdb_prompt_full } {
+    set gdb_prompt_full \
+	"$gdb_prompt_full\\\[infrun\\\] fetch_inferior_event: exit\r\n"
+    gdb_test_sequence $test $test {
+	"need to step-over"
+	"resume_1: step=1,"
+	"signal arrived while stepping over breakpoint"
+	"stepped to a different line"
+	"callme"
+    }
 }
 
 set cnt_after [get_value "args\[$my_number\]" "get count after step"]
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3f61da8adf1..cf64bd21305 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -142,6 +142,9 @@ if ![info exists gdb_prompt] then {
     set gdb_prompt "\\(gdb\\)"
 }
 
+global gdb_prompt_full
+set gdb_prompt_full "$gdb_prompt "
+
 # A regexp that matches the pagination prompt.
 set pagination_prompt \
     "--Type <RET> for more, q to quit, c to continue without paging--"
@@ -1414,7 +1417,7 @@ proc gdb_test_no_output { args } {
 #   -1 if there was an internal error.
 
 proc gdb_test_sequence { command test_name expected_output_list } {
-    global gdb_prompt
+    global gdb_prompt_full
     if { $test_name == "" } {
 	set test_name $command
     }
@@ -1422,7 +1425,7 @@ proc gdb_test_sequence { command test_name expected_output_list } {
     if { $command != "" } {
 	send_gdb "$command\n"
     }
-    return [gdb_expect_list $test_name "$gdb_prompt $" $expected_output_list]
+    return [gdb_expect_list $test_name "$gdb_prompt_full$" $expected_output_list]
 }
 
 \f

  reply	other threads:[~2021-01-05  9:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 20:47 [PATCH v2 1/3] gdb: make "set debug timestamp" work nice with new debug printouts Simon Marchi via Gdb-patches
2020-12-16 20:47 ` [PATCH v2 2/3] gdb: use infrun_debug_printf in print_target_wait_results Simon Marchi via Gdb-patches
2020-12-16 20:47 ` [PATCH v2 3/3] gdb: introduce scoped debug prints Simon Marchi via Gdb-patches
2020-12-22 21:35   ` Simon Marchi via Gdb-patches
2021-01-04 17:02     ` Simon Marchi via Gdb-patches
2021-01-05  9:01       ` Tom de Vries
2021-01-05  9:23         ` Tom de Vries [this message]
2021-01-05 15:33           ` Simon Marchi via Gdb-patches
2021-01-05 17:02             ` Simon Marchi via Gdb-patches
2021-01-05 21:26               ` tdevries
2021-01-05 21:54                 ` Simon Marchi via Gdb-patches
2021-01-06  1:00                   ` Simon Marchi via Gdb-patches
2021-01-06  7:15                     ` Tom de Vries
2021-01-06 19:05                       ` Simon Marchi via Gdb-patches

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=66ff5e72-f002-ed4f-075a-3054d17e7862@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --cc=simon.marchi@polymtl.ca \
    /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