[PATCH 2/2] ptype: add option to use hexadecimal notation

Lancelot SIX lsix@lancelotsix.com
Wed Apr 14 22:45:27 GMT 2021


On Tue, Apr 13, 2021 at 08:08:58PM -0400, Paul Koning wrote:
> 
> 
> > On Apr 13, 2021, at 7:18 PM, John Baldwin <jhb@FreeBSD.org> wrote:
> > 
> > On 12/31/20 4:53 AM, Lancelot SIX via Gdb-patches wrote:
> >> This commit adds a flag to the ptype command in order to print the
> >> offsets and sizes of struct members using the hexadecimal notation. The
> >> 'x' flag ensures use of the hexadecimal notation while the 'X' flag
> >> ensures use of the decimal notation. The default is to use decimal
> >> notation.
> 
> "X" for decimal is rather non-obvious.  How about "d" instead?  Usually X means uppercase hexadecimal.
> 
> 	paul
> 
> 

Hi,

I went for the x/X since other options use the lowercase/uppercase to
activate/deactivate flags (m/M or t/T).  If this is more confusing than
helping, I am fine using 'd' to force decimal notation.  I am just a bit
concerned that with those 2 distinct letters, one could expects to find
two flags ('set print type hex' and 'set print type decimal'), where
only one actually exists.  Is this me overthinking it?

Lancelot.


More information about the Gdb-patches mailing list