[PATCH] Fix use of lazy strings outside of pretty-printers

Yao Qi qiyaoltc@gmail.com
Mon Apr 4 16:26:00 GMT 2016


Doug Evans <dje@google.com> writes:

Hi Doug,
patch is good to me,

> +      long length = self_string->length;
> +      struct type *index_type, *range_type, *array_type;
> +
> +      if (TYPE_OBJFILE_OWNED (elm_type))
> +	index_type
> +	  = objfile_type (TYPE_OWNER (elm_type).objfile)->builtin_long;
> +      else
> +	index_type
> +	  = builtin_type (TYPE_OWNER (elm_type).gdbarch)->builtin_long;
> +
> +      if (self_string->length == -1)

Nit: s/length/self_string->length/

> +	range_type = create_static_range_type (NULL, index_type, 0, -1);
> +      else
> +	range_type
> +	  = create_static_range_type (NULL, index_type, 0, length - 1);

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list