From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 9F0C93858D1E for ; Wed, 4 Jan 2023 09:16:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F0C93858D1E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=lancelotsix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lancelotsix.com Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::146]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 6D5FE805F3; Wed, 4 Jan 2023 09:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lancelotsix.com; s=2021; t=1672823764; bh=B1VN2C2VvB/UY1o0aNA+T85kkQ1f4OzwP/zqyT6dbbc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xv6Lu6Sg0qyzMHG4hPzf8VwUV5zvq0WkjAKHqAkbjol31dcw0yN+GiaePaVVsYDEL YdPM3KQGGN4nyz1b8AbxIBBahF74xHMlbn7vgqnB/eDJ/r8KW7G5sHCtUy/bA49VT7 k/yFh76lS0DyTbpSjQqDxKw+cGR9sl4K6OF56RfdOMYkeCz7RH2MTIQocKkC12QYNA 8ids24UiejrbmB6+DjWxogJj1geLWwMjCvknuq/Deu7spXDakJJ69YdHXRrXqjjMNQ Ehq1APk0FW6uKGWfhuJIE6ln5AiCzK8V+462R0b0y9CgHR/eYmVxlAxtDcZh2u0lz8 4aramL393Ofzw== Date: Wed, 4 Jan 2023 09:15:59 +0000 From: Lancelot SIX To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb: use gdb_test_multiple in gdb_breakpoint Message-ID: <20230104091559.rqo2774ba566j5sg@ubuntu.lan> References: <20230103192216.108444-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230103192216.108444-1-simon.marchi@polymtl.ca> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Wed, 04 Jan 2023 09:16:04 +0000 (UTC) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_SBL_CSS,SPF_HELO_NONE,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: 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. Best, Lancelot. > > - send_gdb "$break_command $linespec\n" > # The first two regexps are what we get with -g, the third is without -g. > - gdb_expect 30 { > + gdb_test_multiple "$break_command $linespec" "" { > -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} > -re "$break_message \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {} > -re "$break_message \[0-9\]* at .*$gdb_prompt $" {} > @@ -659,35 +658,6 @@ proc gdb_breakpoint { linespec args } { > send_gdb "$pending_response\n" > exp_continue > } > - -re "A problem internal to GDB has been detected" { > - if { $print_fail } { > - fail "$test_name (GDB internal error)" > - } > - gdb_internal_error_resync > - return 0 > - } > - -re "$gdb_prompt $" { > - if { $print_fail } { > - fail $test_name > - } > - return 0 > - } > - eof { > - perror "GDB process no longer exists" > - global gdb_spawn_id > - set wait_status [wait -i $gdb_spawn_id] > - verbose -log "GDB process exited with wait status $wait_status" > - if { $print_fail } { > - fail "$test_name (eof)" > - } > - return 0 > - } > - timeout { > - if { $print_fail } { > - fail "$test_name (timeout)" > - } > - return 0 > - } > } > if { $print_pass } { > pass $test_name > > base-commit: a7d5fcaf8e15820f997ba7774a8eef7ab7e2f2e3 > -- > 2.39.0 >