This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [unavailable values part 1, 08/17] unavailable integer internalvars
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 14 Feb 2011 13:00:22 +0100
- Subject: Re: [unavailable values part 1, 08/17] unavailable integer internalvars
- References: <201102071431.48231.pedro@codesourcery.com>
On Mon, 07 Feb 2011 15:31:47 +0100, Pedro Alves wrote:
> --- src.orig/gdb/value.c 2011-01-31 19:57:59.424645004 +0000
> +++ src/gdb/value.c 2011-01-31 19:58:02.114645000 +0000
> @@ -1536,15 +1536,24 @@ value_of_internalvar (struct gdbarch *gd
> int
> get_internalvar_integer (struct internalvar *var, LONGEST *result)
> {
> - switch (var->kind)
> + if (var->kind == INTERNALVAR_INTEGER)
> {
> - case INTERNALVAR_INTEGER:
> *result = var->u.integer.val;
> return 1;
> + }
>
> - default:
> - return 0;
> + if (var->kind == INTERNALVAR_VALUE)
> + {
> + struct type *type = check_typedef (value_type (var->u.value));
> +
> + if (TYPE_CODE (type) == TYPE_CODE_INT)
> + {
> + *result = value_as_long (var->u.value);
> + return 1;
> + }
> }
> +
> + return 0;
> }
[nitpick] That switch would be finally appropriate there now.
Thanks,
Jan