From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/4] Use field_string in more places
Date: Tue, 09 Jul 2019 15:21:00 -0000 [thread overview]
Message-ID: <87imsbgro0.fsf@tromey.com> (raw)
In-Reply-To: <20190702155304.GY23204@embecosm.com> (Andrew Burgess's message of "Tue, 2 Jul 2019 16:53:05 +0100")
>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
>> + current_uiout->field_string ("event_status",
>> + hex_string_custom (event_status, 4));
Andrew> I don't know if it matters, but this will reduce the number of 0s that
Andrew> are printed, if 'event_status = 1' then phex (event_status, 4) will
Andrew> return '00000001' while hex_string_custom will return '0001'.
Andrew> I'm not an SPU user so have no opinion either way...
I don't know either. I looked into this a bit and it seems like a messy
area of gdb:
* hex_string and hex_string_custom take a signed argument, which IMO
doesn't make sense.
* hex_string is basically phex_nz with the 0x prefix; but
hex_string_custom differs in its truncation behavior from phex.
* core_addr_to_string and core_addr_to_string_nz exist; though some
spots choose to print a CORE_ADDR using one of the hex_string
functions; and of course there is paddress and (I just learned this
one) print_core_address.
* paddress probably should be renamed paddress_nz and print_core_address
to paddress, but of course this would be super confusing; and anyway
it seems like it would make more sense to standardize on a single way
to print addresses, or maybe at least a user- (rather than
patch-writer-) configurable one.
Faced with this I chose to flee, and I'm dropping the SPU bits from my
patch. Also I felt this made sense because the SPU code is slated to be
removed.
Tom
next prev parent reply other threads:[~2019-07-09 15:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 15:36 [PATCH v2 0/4] Remove many uses of field_fmt Tom Tromey
2019-07-02 15:36 ` [PATCH v2 1/4] Use field_core_addr in more places Tom Tromey
2019-07-02 15:36 ` [PATCH v2 2/4] Use field_string " Tom Tromey
2019-07-02 15:53 ` Andrew Burgess
2019-07-09 15:21 ` Tom Tromey [this message]
2019-07-02 15:36 ` [PATCH v2 3/4] Introduce field_unsigned Tom Tromey
2019-07-02 15:42 ` [PATCH v2 4/4] Fix a FIXME in mi-out.c Tom Tromey
2019-07-02 15:59 ` [PATCH v2 0/4] Remove many uses of field_fmt Simon Marchi
2019-07-02 16:12 ` Tom Tromey
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=87imsbgro0.fsf@tromey.com \
--to=tom@tromey.com \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.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