[PATCH v2 2/2] [PR gdb/22640] ptype: add option to use hexadecimal notation

Tom Tromey tom@tromey.com
Mon Apr 19 19:38:41 GMT 2021


>>>>> "Lancelot" == Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> writes:

Lancelot> This commit adds a flag to the ptype command in order to print the
Lancelot> offsets and sizes of struct members using the hexadecimal notation.  The
Lancelot> 'x' flag ensures use of the hexadecimal notation while the 'd' flag
Lancelot> ensures use of the decimal notation.  The default is to use decimal
Lancelot> notation.

This approach seems reasonable to me.

Lancelot> Before this patch, gdb only uses decimal notation, as pointed out in PR
Lancelot> gdb/22640.

Lancelot> +/* See typeprint.h.  */
Lancelot> +
Lancelot> +print_offset_data::print_offset_data(const struct type_print_options *flags)

A nit: space before the open paren here.

Eli will have to approve the documentation changes, if he hasn't
already.

The rest of the patch is ok with that one nit fixed.  Thank you for
doing this.

Tom


More information about the Gdb-patches mailing list