Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 1/2] Fix two regressions in scalar printing
Date: Fri, 14 Jul 2017 17:25:00 -0000	[thread overview]
Message-ID: <e341effa-cdc4-a876-9f19-f2ad4d3fe0ff@redhat.com> (raw)
In-Reply-To: <871spjufnv.fsf@pokyo>


On 07/14/2017 05:49 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
> 
> Pedro> I think this would all be fixed by simply having separate
> Pedro> 'u'/'d' cases with fixed signness:
> 
> Pedro>     case 'u':
> Pedro>       print_decimal_chars (stream, valaddr, len, false, byte_order);
> Pedro>       break;
> Pedro>     case 'd':
> Pedro>       print_decimal_chars (stream, valaddr, len, true, byte_order);
> Pedro>       break;
> 
> I'm testing this.  Thanks for the feedback.
> 
> One early note is that this changes the expected output for this test:
> 
> FAIL: gdb.dwarf2/var-access.exp: verify re-initialized s2
> 
> Now it says:
> 
> print/d s2
> $9 = {a = -65, b = 73, c = -25, d = 123}
> 
> but the test wants:
> 
> gdb_test "print/d s2"  " = \\{a = 191, b = 73, c = 231, d = 123\\}" \
>     "verify re-initialized s2"
> 

Yeah, that seems OK to me GDB-output-wise.  "You get what you ask for".

Now, the test is for "# Byte-aligned register- and memory pieces.", and
is treating the bytes as raw bytes, even though the fields are
defined as "char".

We see just above that a test setting the fields using values over 0x7f:

 gdb_test_no_output "set var s2 = {191, 73, 231, 123}" \
     "re-initialize s2"
 gdb_test "print/d s2"  " = \\{a = 191, b = 73, c = 231, d = 123\\}" \
     "verify re-initialized s2"

The /d was surely as a convenience to avoid printing the bytes
in character format.  I'd just change it to /u.  Same for the related
tests just above.

Thanks,
Pedro Alves


  reply	other threads:[~2017-07-14 17:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170713123400.28917-1-tom@tromey.com>
2017-07-13 12:34 ` [RFA 2/2] Remove BITS_IN_BYTES define Tom Tromey
2017-07-14 15:16   ` Pedro Alves
2017-07-14 16:15     ` Tom Tromey
2017-07-13 12:35 ` [RFA 1/2] Fix two regressions in scalar printing Tom Tromey
2017-07-14 14:56   ` Pedro Alves
2017-07-14 15:20     ` Eli Zaretskii
2017-07-14 16:50     ` Tom Tromey
2017-07-14 17:25       ` Pedro Alves [this message]
2017-07-31 22:03         ` Tom Tromey
2017-08-14 14:02           ` Pedro Alves
2017-08-14 15:22             ` Tom Tromey
2017-08-14 15:43               ` Tom Tromey
2017-08-14 15:52                 ` Pedro Alves
2017-08-17  2:24                 ` Tom Tromey
2017-12-10 14:15                   ` Regression on 32-bit: gdb.guile/scm-ports.exp [Re: [RFA 1/2] Fix two regressions in scalar printing] Jan Kratochvil
2017-07-14 15:19   ` [RFA 1/2] Fix two regressions in scalar printing Jonah Graham
2017-08-25 16:54   ` Thomas Preudhomme

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=e341effa-cdc4-a876-9f19-f2ad4d3fe0ff@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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