Re: RFA: fix PR 9164

Pedro Alves
2009-01-05T17:29:46Z

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