public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Ruslan Kabatsayev <b7.10110111@gmail.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Make tests expect [ \t]+ pattern instead of \t for "info reg" command
Date: Mon, 08 Jan 2018 06:42:00 -0000	[thread overview]
Message-ID: <CAHEcG96snuVzqnb5jpZXCDn6x=t_ek+9SnLK=5g-A1_qfOMgPA@mail.gmail.com> (raw)
In-Reply-To: <20180108042544.yzq3egkfph2c6v45@adacore.com>

On 8 January 2018 at 07:25, Joel Brobecker <brobecker@adacore.com> wrote:
> On Mon, Jan 08, 2018 at 01:18:30AM +0300, Ruslan Kabatsayev wrote:
>> This will allow to format output of "info reg" command as we wish,
>> without breaking the tests. In particular, it'll let us correctly align
>> raw and natural values of the registers using spaces instead of current
>> badly-working approach with tabs.
>>
>> This change is forwards- and backwards-compatible, so that the amended
>> tests will work in the same way before and after reformatting patches
>> (unless the tests check formatting, of course, but I've not come across
>> any such tests).
>>
>> Some tests already used this expected pattern, so they didn't
>> even have to be modified. Others are changed by this patch.
>>
>> I've checked this on a i386 system, with no noticeable differences in
>> test results, so at least on i386 nothing seems to be broken by this.
>>
>> gdb/testsuite/ChangeLog:
>>
>>       * gdb.arch/powerpc-d128-regs.exp: Replace expected "\[\t\]*" from
>>       "info reg" with "\[ \t\]*".
>>       * gdb.arch/altivec-regs.exp: Replace expected "\t" from "info reg" with
>>       "\[ \t\]+".
>>       * gdb.arch/s390-multiarch.exp: Ditto.
>>       * gdb.base/pc-fp.exp: Ditto.
>>       * gdb.reverse/i386-precsave.exp: Ditto.
>>       * gdb.reverse/i386-reverse.exp: Ditto.
>>       * gdb.reverse/i387-env-reverse.exp: Ditto.
>>       * gdb.reverse/i387-stack-reverse.exp: Ditto.
>
> No objection on my end. I might have used \\s instead of \[ \t\],
> but perhaps there was a reason not to; and even if not, no point
> in redoing it all now.

\\s would also allow newlines, form feeds etc., which doesn't look
like a good idea here.

>
> Anyone against this change?
>
> One comment:
>
>> diff --git a/gdb/testsuite/gdb.base/pc-fp.exp b/gdb/testsuite/gdb.base/pc-fp.exp
>> index 5230b2b..8a81db4 100644
>> --- a/gdb/testsuite/gdb.base/pc-fp.exp
>> +++ b/gdb/testsuite/gdb.base/pc-fp.exp
>> @@ -58,4 +58,4 @@ gdb_test "info register \$fp" "${valueof_fp}.*"
>>  # Regression test for
>>  # http://sourceware.org/bugzilla/show_bug.cgi?id=12659
>>  gdb_test "info register pc fp" \
>> -    "pc +${valueof_pc}\t${valueof_pc} <.*>\[\r\n\]+fp +${valueof_fp}\t${valueof_fp}\[\r\n\]+"
>> +    "pc +${valueof_pc}\[ \t\]+${valueof_pc} <.*>\[\r\n\]+fp +${valueof_fp}\[ \t\]+${valueof_fp}\[\r\n\]+"
>
> This change looks like it's doing more than just allowing spaces
> on top of tabs...

Well it allows _multiple_ spaces/tabs instead of exactly one tab —
exactly what we need to be compatible with space-alignment. In other
respects I don't see what else it does.

>
> For the rest of this (large and mechanical patch), I tried my best
> to pay attention to all the details.
>
> --
> Joel

  reply	other threads:[~2018-01-08  6:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-07 22:19 Ruslan Kabatsayev
2018-01-08  4:25 ` Joel Brobecker
2018-01-08  6:42   ` Ruslan Kabatsayev [this message]
2018-01-08  7:33     ` Joel Brobecker
2018-01-18 15:18 ` Yao Qi
2018-01-18 15:42   ` Ruslan Kabatsayev
2018-01-18 21:12     ` Yao Qi

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='CAHEcG96snuVzqnb5jpZXCDn6x=t_ek+9SnLK=5g-A1_qfOMgPA@mail.gmail.com' \
    --to=b7.10110111@gmail.com \
    --cc=brobecker@adacore.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).