This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: mips-tdep.c: Sign-extend pointers for n32
On Thu, 20 Dec 2007, Daniel Jacobowitz wrote:
> I think there's still a problem here, though it is somewhat endemic to
> the argument passing routines:
>
> TYPE_CODE_ENUM, /* Enumeration type */
> TYPE_CODE_REF, /* C++ Reference types */
> TYPE_CODE_CHAR, /* *real* character type */
> TYPE_CODE_BOOL,
>
> And possibly TYPE_CODE_MEMBERPTR too... that's a signed offset,
> probably 32-bit in the n32 case. Getting this right is a real
> pain.
Hmm, these are obviously C-style types and I would expect other languages
to have their own specific ones (Ada, anyone?). As they map somehow to
the integer types provided by the underlying architecture, wouldn't it be
a good idea to actually record which of the plain CPU-specific types each
of the language types corresponds to?
This way the mapping would only be provided in a single place -- the
language ABI for a given architecture -- and all the generic
target-dependent and possibly target-independent code would not have to
iterate over all the language types, which is obviously prone to errors
and hard to fully cover in the test suite.
Maciej