From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 3448C3858D35 for ; Wed, 4 Jan 2023 16:12:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3448C3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 304GB6LP020838 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 4 Jan 2023 11:11:11 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 304GB6LP020838 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1672848671; bh=STCS2Qxhti2lTjzS6bSgD/TUqMMfckBgeYowuy9nJ/Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kBHNzU73Sk56E2JMUOsNG0XtRzV5+1BGTRbh+qToSQlel6UXUSbI1qgrAZQ1Hp5QK tCDTdBqOk2KDc+utv4vbjdq3C9Ht/C9+Yecx+rUJ+qI5/EQqk7eXCRo5A7ZibntOAi UaurP/A8OgXIdvlcvD0oiFGp4w2CG4b5Hdlzebqc= Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 73CBD1E110; Wed, 4 Jan 2023 11:11:06 -0500 (EST) Message-ID: <9b050608-4bb6-dbc3-69f6-ebc9ad2cc303@polymtl.ca> Date: Wed, 4 Jan 2023 11:11:05 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] gdb: use gdb_test_multiple in gdb_breakpoint Content-Language: en-US To: Lancelot SIX Cc: gdb-patches@sourceware.org References: <20230103192216.108444-1-simon.marchi@polymtl.ca> <20230104091559.rqo2774ba566j5sg@ubuntu.lan> From: Simon Marchi In-Reply-To: <20230104091559.rqo2774ba566j5sg@ubuntu.lan> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 4 Jan 2023 16:11:06 +0000 X-Spam-Status: No, score=-3038.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/4/23 04:15, Lancelot SIX wrote: > Hi Simon, > > On Tue, Jan 03, 2023 at 02:22:16PM -0500, Simon Marchi via Gdb-patches wrote: >> When running the testsuite in a non-optimized build on a slow machine, I >> sometimes get: >> >> UNTESTED: gdb.gdb/selftest.exp: Cannot set breakpoint at captured_main, skipping testcase. >> >> do_self_tests, in lib/selftest-support.exp, uses `with_timeout_factor >> 10`, to account for the fact that reading the debug info of the gdb >> binary (especially in a non-optimized GDB) can take time. But then it >> ends up calling gdb_breakpoint, which uses gdb_expect with a hard-coded >> timeout of 30 seconds. >> >> Fix this by making gdb_breakpoint use gdb_test_multiple, which is a >> desired change anyway for this kind of simple command / expected >> output case. >> >> Change-Id: I9b06ce991cc584810d8cc231b2b4893980b8be75 >> --- >> gdb/testsuite/lib/gdb.exp | 32 +------------------------------- >> 1 file changed, 1 insertion(+), 31 deletions(-) >> >> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp >> index 135ace68d5ed..5a0cd46d8998 100644 >> --- a/gdb/testsuite/lib/gdb.exp >> +++ b/gdb/testsuite/lib/gdb.exp >> @@ -641,9 +641,8 @@ proc gdb_breakpoint { linespec args } { >> >> set test_name "gdb_breakpoint: set breakpoint at $linespec" > > Should you use $test_name as second arg of the call to gdb_test_multiple > you introduce? This way the error cases handled by gdb_test_multiple > will the desired test name. > > Also, I guess that to make is slightly more consistent with other usages > of gdb_test_multiple, $gdb_test_name should be used instead of > $test_name in the untouched actions. Oh, right, I missed that. I folded the test name in the gdb_test_multiple call (removed the test_name var) and used $gdb_test_name in the fail call. I updated the patch locally. Should I add your Reviewed-By after those changes? Simon