public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <pedro@palves.net>, Tom de Vries <tdevries@suse.de>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: use gdb_test_multiple in gdb_breakpoint
Date: Tue, 10 Jan 2023 10:50:28 -0500	[thread overview]
Message-ID: <ba849cb2-ad0e-774e-0bec-5fa1404ec31a@polymtl.ca> (raw)
In-Reply-To: <f9b30348-55a4-410e-f24e-24233043efec@palves.net>



On 1/10/23 10:33, Pedro Alves wrote:
> On 2023-01-05 4:28 p.m., Simon Marchi via Gdb-patches wrote:
> 
>> ---
>>  gdb/testsuite/lib/gdb.exp | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
>> index e17eace4cb13..af538e5c8fbd 100644
>> --- a/gdb/testsuite/lib/gdb.exp
>> +++ b/gdb/testsuite/lib/gdb.exp
>> @@ -657,6 +657,12 @@ proc gdb_breakpoint { linespec args } {
>>                 send_gdb "$pending_response\n"
>>                 exp_continue
>>         }
>> +       -re "$gdb_prompt $" {
>> +           if { $print_fail } {
>> +               fail $test_name
>> +           }
>> +           return 0
>> +       }
>>      }
> 
> The other removed "-re" cases also considered $print_fail, so if their replacement
> inside gdb_test_multiple is hit, they'll produce a FAIL.  Was that intended?
> Should we instead add a "-nofail" option to gdb_test / gdb_test_multiple ?

Good point, this is a change in behavior.  Does this change cause you an
unexpected FAIL in practice?  I was actually planning on removing that
message / no-message option to gdb_breakpoint [1] to simplify it.  I
don't see any use for the current behavior, I'd rather have it log a
test result all the time.  I can kind of see when that would maybe be
useful: if you wanted to set a breakpoint, and it could legitimately not
work (you could do something with gdb_breakpoint's return value).  But
you could also use the break command directly, like many places do
already, so it's not really needed.  Anyway, all of this to say that I
could fix what you pointed out by pruning / simplifying code rather than
adding more.

Simon

[1] https://review.lttng.org/c/binutils-gdb/+/7158/6


  reply	other threads:[~2023-01-10 15:50 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
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 [this message]
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=ba849cb2-ad0e-774e-0bec-5fa1404ec31a@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=tdevries@suse.de \
    /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).