mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-12-14 15:50:34 +00:00
* value.c (value_static_field): Use switch' instead of
if'.
Assert-fail if passed invalid TYPE_FIELD_LOC_KIND.
This commit is contained in:
parent
9f18a3b398
commit
1596cb5d60
@ -1,5 +1,8 @@
|
||||
2010-06-27 Doug Evans <dje@google.com>
|
||||
|
||||
* value.c (value_static_field): Use `switch' instead of `if'.
|
||||
Assert-fail if passed invalid TYPE_FIELD_LOC_KIND.
|
||||
|
||||
* valops.c (search_struct_field): Fix typo in error message.
|
||||
|
||||
2010-06-26 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
14
gdb/value.c
14
gdb/value.c
@ -1850,7 +1850,7 @@ unpack_pointer (struct type *type, const gdb_byte *valaddr)
|
||||
}
|
||||
|
||||
|
||||
/* Get the value of the FIELDN'th field (which must be static) of
|
||||
/* Get the value of the FIELDNO'th field (which must be static) of
|
||||
TYPE. Return NULL if the field doesn't exist or has been
|
||||
optimized out. */
|
||||
|
||||
@ -1859,12 +1859,13 @@ value_static_field (struct type *type, int fieldno)
|
||||
{
|
||||
struct value *retval;
|
||||
|
||||
if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR)
|
||||
switch (TYPE_FIELD_LOC_KIND (type, fieldno))
|
||||
{
|
||||
case FIELD_LOC_KIND_PHYSADDR:
|
||||
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
|
||||
TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
|
||||
}
|
||||
else
|
||||
break;
|
||||
case FIELD_LOC_KIND_PHYSNAME:
|
||||
{
|
||||
char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
|
||||
/*TYPE_FIELD_NAME (type, fieldno);*/
|
||||
@ -1897,7 +1898,12 @@ value_static_field (struct type *type, int fieldno)
|
||||
if (retval && VALUE_LVAL (retval) == lval_memory)
|
||||
SET_FIELD_PHYSADDR (TYPE_FIELD (type, fieldno),
|
||||
value_address (retval));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
gdb_assert (0);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user