This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: fix PR 9164
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org, Tom Tromey <tromey at redhat dot com>
- Date: Mon, 5 Jan 2009 17:29:39 +0000
- Subject: Re: RFA: fix PR 9164
- References: <m34p0grssm.fsf@fleche.redhat.com>
On Saturday 03 January 2009 21:19:53, Tom Tromey wrote:
> +static void
> +find_size_type (const struct builtin_type *builtin,
> +???????????????struct language_arch_info *lai)
> +{
> + ?lai->size_type_symbol = "size_t";
> +
> + ?/* For the default, pick an unsigned integral type the same width as
> + ? ? a data pointer, if possible. ?If none match, use unsigned int. ?*/
> + ?if (TYPE_LENGTH (builtin->builtin_unsigned_long)
> + ? ? ?== TYPE_LENGTH (builtin->builtin_data_ptr))
> + ? ?lai->size_type_default = builtin->builtin_unsigned_long;
> + ?else if (TYPE_LENGTH (builtin->builtin_unsigned_long_long))
> + ? ?lai->size_type_default = builtin->builtin_unsigned_long_long;
> + ?else
> + ? ?lai->size_type_default = builtin->builtin_unsigned_int;
> +}
I think that m32c will need a hook here. I think that in some modes, size_t will
be 16-bit, but pointer width 24-bits.
I wonder if the above shouldn't be a gdbarch method, that defaults to
what you wrote.
--
Pedro Alves