public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 4/5] gdb/testsuite: change newline patterns used in gdb_test
Date: Tue, 2 May 2023 16:48:21 +0200	[thread overview]
Message-ID: <c0203bbb-ca06-0a0f-159b-b400296d8f7b@suse.de> (raw)
In-Reply-To: <87ttwv7zq8.fsf@redhat.com>

On 5/2/23 13:13, Andrew Burgess wrote:
> Tom de Vries <tdevries@suse.de> writes:
> 
>> On 5/1/23 16:33, Andrew Burgess wrote:
>>> Tom de Vries <tdevries@suse.de> writes:
>>>
>>>> On 3/31/23 22:20, Andrew Burgess via Gdb-patches wrote:
>>>>> This commit makes two changes to how we match newline characters in
>>>>> the gdb_test proc.
>>>>
>>>> Hi,
>>>>
>>>> the -wrap used in gdb_test_multiple is defined in terms of gdb_test
>>>> semantics, but it doesn't seem to have been updated to match the new
>>>> behaviour in gdb_test.
>>>>
>>>> I've filed a PR about this regression (
>>>> https://sourceware.org/bugzilla/show_bug.cgi?id=30403 ).
>>>
>>> Sorry for any problems caused.  I'm not working today, but if this has
>>> not been addressed, I'll look at this on Tuesday.
>>
>> AFAIU it's a silent regression, so there are no problems in term of
>> FAILs, it's just that more work is required.
>>
>> FWIW, I think the root cause for introducing this regression silently is
>> that we try to implement the same thing in two different locations, and
>> it's just easy for things to get out of sync.  I recently fixed
>> something similar in commit 4fa173cfd79 ("[gdb/testsuite] Fix -wrap in
>> presence of -prompt in gdb_test_multiple"), that's why I noticed it.
> 
> So I believe the patch below brings gdb_test_multiple with '-wrap' back
> into line with gdb_test.  I also updated a couple of other places that
> used the same (old) gdb_test pattern.
> 
> There were nowhere near as many regressions with this change as with
> gdb_test.  Let me know what you think.
> 

I've applied the patch and tested it, and saw no regression.  I've also 
reviewed the patch and LGTM.

However, I've now also realized that the ^ bit is missing, which was 
also added in this patch series.

In other words, say we have:
...
gdb_test "print 1" "^.$decimal = 1"
...
which passes fine.

But then we want to annotate the PASS message with the captured 
$decimal, and rewrite into:
...
gdb_test_multiple "print 1" "" {
     -re -wrap "^.($decimal) = 1" {
         set var_nr $expect_output(1,string)
         pass "$gdb_test_name (var_nr: $var_nr)"
     }
}
...
This FAILs because ^ at the start of the pattern is not handled the same 
way by -wrap as by gdb_test.

Thanks,
- Tom

  reply	other threads:[~2023-05-02 14:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 20:20 [PATCH 0/5] gdb/testsuite: stricter matching for gdb_test Andrew Burgess
2023-03-31 20:20 ` [PATCH 1/5] gdb/testsuite: fix occasional failure in gdb.base/clear_non_user_bp.exp Andrew Burgess
2023-03-31 20:20 ` [PATCH 2/5] gdb: remove some trailing newlines from warning messages Andrew Burgess
2023-03-31 20:20 ` [PATCH 3/5] gdb/testsuite: use 'return' in gdb_test_no_output Andrew Burgess
2023-03-31 20:20 ` [PATCH 4/5] gdb/testsuite: change newline patterns used in gdb_test Andrew Burgess
2023-04-27 19:39   ` Simon Marchi
2023-04-28 14:05     ` Andrew Burgess
2023-04-28 15:51     ` Andrew Burgess
2023-04-28 15:57       ` Simon Marchi
2023-04-28 18:37         ` Simon Marchi
2023-04-28 21:50           ` Andrew Burgess
2023-05-02 19:16             ` Simon Marchi
2023-04-29 15:20   ` Tom de Vries
2023-05-01 14:33     ` Andrew Burgess
2023-05-01 15:10       ` Tom de Vries
2023-05-02 11:13         ` Andrew Burgess
2023-05-02 14:48           ` Tom de Vries [this message]
2023-05-05 17:01             ` Andrew Burgess
2023-05-09  9:54               ` Andrew Burgess
2023-05-10  7:22                 ` Tom de Vries
2023-05-12 12:54                   ` Andrew Burgess
2023-03-31 20:20 ` [PATCH 5/5] gdb/testsuite: special case '^' in gdb_test pattern Andrew Burgess
2023-04-17 16:12 ` [PATCH 0/5] gdb/testsuite: stricter matching for gdb_test Tom Tromey
2023-04-27 12:58   ` Andrew Burgess

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=c0203bbb-ca06-0a0f-159b-b400296d8f7b@suse.de \
    --to=tdevries@suse.de \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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).