This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: fix PR 9164
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
Tom> This fix defers the choice of type to the language, using the existing
Tom> language-arch machinery. I fixed the C language family, including
Tom> ObjC, but I left the other languages unchanged. I think the language
Tom> maintainers will have to make a change here, if one is needed or
Tom> desired. (FWIW I don't think Java needs a change, since I don't think
Tom> it is possible to invoke sizeof when Java is the selected language.)
Daniel> Before adding all this, do you know of any language where the signed
Daniel> behavior is correct?
Nope. I don't know that a signed type is incorrect, either. I really
know nothing about the other languages here, so I chose to preserve
the current behavior.
Even if all languages want an unsigned type, I still think something
like this patch is the way to go, because for C languages you
generally want the inferior's "size_t".
That is, this is the way to go assuming that we continue to have
language-dependent expressions. If it weren't for UNOP_SIZEOF, I
probably would have made this a C-specific patch. Another idea would
be to add an evaluate_subexp_c, and have it handle UNOP_SIZEOF.
Tom