[PATCH 2/2] gdb/python: add Type.signedness attribute

Tom Tromey tom@tromey.com
Fri Dec 3 21:05:16 GMT 2021


>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:

Andrew> Add a new gdb.Type.signedness attribute that describes whether a type
Andrew> is signed or not.

Andrew> Unfortunately types can be signed, unsigned, or neither, so this
Andrew> attribute is not a boolean, but is instead a integer that takes the
Andrew> value of one of three new constants:

Andrew>    gdb.TYPE_SIGNEDNESS_SIGNED
Andrew>    gdb.TYPE_SIGNEDNESS_UNSIGNED
Andrew>    gdb.TYPE_SIGNEDNESS_NONE

It wasn't super clear to me which of these applies to non-scalar types,
like a union.  I'd guess 'NONE', but is that what really happens?

Other than that the patch looks reasonable to me.

Tom


More information about the Gdb-patches mailing list