public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Lancelot SIX <lsix@lancelotsix.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: use gdb_test_multiple in gdb_breakpoint
Date: Wed, 4 Jan 2023 11:11:05 -0500	[thread overview]
Message-ID: <9b050608-4bb6-dbc3-69f6-ebc9ad2cc303@polymtl.ca> (raw)
In-Reply-To: <20230104091559.rqo2774ba566j5sg@ubuntu.lan>



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


  reply	other threads:[~2023-01-04 16:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 19:22 Simon Marchi
2023-01-04  9:15 ` Lancelot SIX
2023-01-04 16:11   ` Simon Marchi [this message]
2023-01-04 16:18     ` Lancelot SIX
2023-01-04 16:22       ` Simon Marchi
2023-01-04 17:40         ` Lancelot SIX
2023-01-04 18:02           ` Lancelot SIX
2023-01-04 19:05             ` Simon Marchi
2023-01-04 19:12               ` Lancelot SIX
2023-01-05  9:04 ` Tom de Vries
2023-01-05 16:28   ` Simon Marchi
2023-01-05 16:31     ` Tom de Vries
2023-01-05 16:36       ` Simon Marchi
2023-01-10 15:33     ` Pedro Alves
2023-01-10 15:50       ` Simon Marchi
2023-01-10 19:56         ` Pedro Alves
2023-01-10 20:42           ` Simon Marchi
2023-01-11 19:05             ` Pedro Alves
2023-01-11 19:42               ` Simon Marchi

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=9b050608-4bb6-dbc3-69f6-ebc9ad2cc303@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    /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).