public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH 4/5] gdb/testsuite: change newline patterns used in gdb_test
Date: Fri, 28 Apr 2023 15:05:22 +0100	[thread overview]
Message-ID: <875y9gayql.fsf@redhat.com> (raw)
In-Reply-To: <9c4e4ce6-9986-1c3a-9885-f4f3388e95f6@simark.ca>

Simon Marchi <simark@simark.ca> writes:

> On 3/31/23 16:20, Andrew Burgess via Gdb-patches wrote:
>> This commit makes two changes to how we match newline characters in
>> the gdb_test proc.
>> 
>> First, for the newline pattern between the command output and the
>> prompt, I propose changing from '[\r\n]+' to an explicit '\r\n'.
>> 
>> The old pattern would spot multiple newlines, and so there are a few
>> places where, as part of this commit, I've needed to add an extra
>> trailing '\r\n' to the pattern in the main test file, where GDB's
>> output actually includes a blank line.
>> 
>> But I think this is a good thing.  If a command produces a blank line
>> then we should be checking for it, the current test doesn't.
>> 
>> Additionally, the existing pattern will happily match a partial
>> newline.  There are a strangely large number of tests that end with a
>> random '.' character.  Not matching a literal period, but matching any
>> single character, this is then matching half of the trailing newline
>> sequence, while the \[\r\n\]+ in gdb_test is matching the other half
>> of the sequence.  I can think of no reason why this would be
>> intentional.  All of these are cleaned up after this commit.
>> 
>> The basic rule of gdb_test after this is that the expected pattern
>> needs to match everything up to, but not including the newline
>> sequence immediately before the GDB prompt.
>> 
>> Second, while I was cleaning up newline matching in gdb_test, I've
>> also removed the '[\r\n]*' that was added to the start of the pattern
>> passed to gdb_test_multiple.
>> 
>> The addition of this pattern adds no value.  If the user pattern
>> matches at the start of a line then this would match against the
>> newline sequence.  But, due to the '*', if the user pattern doesn't
>> match at the start of a line then this group doesn't care, it'll
>> happily match nothing.
>> 
>> As such, there's no value to it, it just adds more complexity for no
>> gain, so I'm removing it.  No tests will need updating as a
>> consequence of this part of the patch.
>
> Hi Andrew,
>
> Starting with this patch, I see many new failures in gdb.trace (using
> one of the gdbserver boards), for instance the first one being:
>
>   FAIL: gdb.trace/collection.exp: collect args collectively: collected arg char

Sorry for that.

I thought I'd run the gdbserver tests, but I guess not.

I have a fix for gdb.trace/collection.exp, I'm just running the full set
of tests to see if there are any other regressions I missed.

I'll push the fix(es) soon.

Thanks,
Andrew


  reply	other threads:[~2023-04-28 14:05 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 [this message]
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
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=875y9gayql.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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).