diff options
author | Daniel Jacobowitz <dan@debian.org> | 2009-07-21 18:15:32 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2009-07-21 18:15:32 +0000 |
commit | 07491b3409f6ace0b7a9a707775a56ce10fece1c (patch) | |
tree | d2a0e6c48d45999e8201741dd65ebfe6532da49e /gdb/value.h | |
parent | 42275759a4f2a4ad0d9c103dc4979573f576d42f (diff) | |
download | gdb-07491b3409f6ace0b7a9a707775a56ce10fece1c.tar.gz |
gdb/
* valops.c (value_fetch_lazy): Handle bitfields explicitly.
(value_assign): Remove unnecessary FIXME. Honor the container
type of bitfields if possible.
* value.c (struct value): Add parent field.
(value_parent): New function.
(value_free): Free the parent also.
(value_copy): Copy the parent also.
(value_primitive_field): Do not read the contents of a lazy
value to create a child bitfield value. Set bitpos and offset
according to the container type if possible.
(unpack_bits_as_long): Rename from unpack_field_as_long. Take
field_type, bitpos, and bitsize instead of type and fieldno.
(unpack_field_as_long): Use unpack_bits_as_long.
* value.h (value_parent, unpack_bits_as_long): New prototypes.
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h index 039e160bfe7..29ad783d429 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -76,6 +76,12 @@ extern void set_value_bitsize (struct value *, int bit); extern int value_bitpos (struct value *); extern void set_value_bitpos (struct value *, int bit); +/* Only used for bitfields; the containing value. This allows a + single read from the target when displaying multiple + bitfields. */ + +struct value *value_parent (struct value *); + /* Describes offset of a value within lval of a structure in bytes. If lval == lval_memory, this is an offset to the address. If lval == lval_register, this is a further offset from location.address @@ -329,6 +335,8 @@ extern LONGEST unpack_long (struct type *type, const gdb_byte *valaddr); extern DOUBLEST unpack_double (struct type *type, const gdb_byte *valaddr, int *invp); extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); +LONGEST unpack_bits_as_long (struct type *field_type, const gdb_byte *valaddr, + int bitpos, int bitsize); extern LONGEST unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno); |