This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: fix PR 9164
On Monday 05 January 2009 18:29:41, Tom Tromey wrote:
> >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
>
> Pedro> I think that m32c will need a hook here. I think that in some
> Pedro> modes, size_t will be 16-bit, but pointer width 24-bits.
>
> Pedro> I wonder if the above shouldn't be a gdbarch method, that defaults to
> Pedro> what you wrote.
>
> Yeah, I do see some gcc ports where size_t depends on the flags.
> Not m32c, actually, but:
Ah, you're only looking for SIZE_TYPE:
/* We can do QI, HI, and SI operations pretty much equally well, but
GCC expects us to have a "native" format, so we pick the one that
matches "int". Pointers are 16 bits for R8C/M16C (when TARGET_A16
is true) and 24 bits for M32CM/M32C (when TARGET_A24 is true), but
24-bit pointers are stored in 32-bit words. */
#define BITS_PER_UNIT 8
#define UNITS_PER_WORD 2
#define POINTER_SIZE (TARGET_A16 ? 16 : 32)
#define POINTERS_EXTEND_UNSIGNED 1
...
#define INT_TYPE_SIZE 16
So, SIZE_TYPE defaults to unsigned int --- 16-bit, but the pointer size
varies. This means that objects can only be 16-bit big, but they can
exist in a larger than 16-bit address space.
--
Pedro Alves