This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix crash of convenience vars with typedefs.
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 17 Aug 2009 15:08:39 +0200 (CEST)
- Subject: Re: [RFA] Fix crash of convenience vars with typedefs.
Doug Evans wrote:
> gdb/value.c:1094: internal-error: bad type
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
Oops, sorry for the breakage.
> + struct type *real_type = check_typedef (var->u.scalar.type);
> + switch (TYPE_CODE (check_typedef (real_type)))
That's a duplicate check_typedef ...
> + case TYPE_CODE_INT:
> + val = value_from_longest (real_type, var->u.scalar.val.l);
> + break;
> + case TYPE_CODE_PTR:
> + val = value_from_pointer (real_type, var->u.scalar.val.a);
> + break;
Shouldn't the result of value_of_internalvar still have the original
typedef name instead of the type it resolves to?
I'm wondering about the other places where the type is used, in particular
get_internalvar_integer. Also, it seems better to avoid calling
check_typedef every time ...
Maybe it would be best to split the INTERNALVAR_SCALAR state into two
distinct states INTERNALVAL_INTEGER and INTERNAL_POINTER; the decision
can be make in set_internalvar, where we already call check_typedef,
and then used subsequentially.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com