From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KbFmGRsw9F8dOAAAWB0awg (envelope-from ) for ; Tue, 05 Jan 2021 04:23:39 -0500 Received: by simark.ca (Postfix, from userid 112) id 5A0551F0AA; Tue, 5 Jan 2021 04:23:39 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9CDCB1E965 for ; Tue, 5 Jan 2021 04:23:38 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C1FF3857831; Tue, 5 Jan 2021 09:23:38 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 0B77C3857C74 for ; Tue, 5 Jan 2021 09:23:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0B77C3857C74 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 13869B74F; Tue, 5 Jan 2021 09:23:35 +0000 (UTC) Subject: Re: [PATCH v2 3/3] gdb: introduce scoped debug prints From: Tom de Vries To: Simon Marchi , Simon Marchi , gdb-patches@sourceware.org References: <20201216204737.900975-1-simon.marchi@efficios.com> <20201216204737.900975-3-simon.marchi@efficios.com> <3ad3b11f-8a72-cd1d-a138-59c47300f147@polymtl.ca> Message-ID: <66ff5e72-f002-ed4f-075a-3054d17e7862@suse.de> Date: Tue, 5 Jan 2021 10:23:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------873EE6F4704CF900473183A8" Content-Language: en-US X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This is a multi-part message in MIME format. --------------873EE6F4704CF900473183A8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 --------------873EE6F4704CF900473183A8 Content-Type: text/x-patch; charset=UTF-8; name="tmp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tmp.patch" 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 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] } --------------873EE6F4704CF900473183A8--