This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING (docs)] Re: [PATCH] [1/2] Add new 'z' format for print command


On 24/07/2013 3:34 PM, Eli Zaretskii wrote:

> More importantly, I have a difficulty understanding what does
> "hexadecimal zero padded to the size ..." mean.  More accurately, if
> my interpretation of what you say (that 'z' produces "00"s for
> non-existing data, then why does this "padding" make sense, when we
> are targeting a human consumer?

I'm not sure I agree with the "non-existing data" part of your
statement, for example a 4-byte register containing the value 1 (one)
when printed with /x would print 0x1, with /z it would print 0x00000001,
surely the leading 0s do exist, we just normally don't print them.

I agree that for a human consumer /z might not be so useful, but moving
this code from being MI specific, to being a core format has cleaned up
an annoying bug, and does mean that the two interfaces offer the same
set of display formats.

You might argue that either:

  (1) We should prevent this format being used in non-mi mode as it is
      not useful.  Given what a small feature this is, and for the
      consistent interface reason, I'd prefer to keep it available. Or,

  (2) We allow it, but only document it in the MI part of the document,
      so CLI users are not 'tempted' to use it.  I don't like this as it
      presupposes what a user will / will not find useful, and make the
      documentation seem incomplete.

I'd be interested to get your thoughts though.

Thanks,
Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]