diff options
author | Pedro Alves <palves@redhat.com> | 2011-02-14 11:25:59 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-02-14 11:25:59 +0000 |
commit | 5467c6c807fb015675b2f1b7c2e012893b998d7c (patch) | |
tree | e722ad892f8b1a66b1eea3fafce11736be05528e /gdb/value.h | |
parent | 3158c6ed12f939c10d31152fd3eb48ea0f8b8eaa (diff) | |
download | gdb-5467c6c807fb015675b2f1b7c2e012893b998d7c.zip gdb-5467c6c807fb015675b2f1b7c2e012893b998d7c.tar.gz gdb-5467c6c807fb015675b2f1b7c2e012893b998d7c.tar.bz2 |
gdb/
* value.h (unpack_bits_as_long): Delete declaration.
(unpack_value_bits_as_long): Declare.
(unpack_value_field_as_long): Declare.
(value_field_bitfield): Declare.
* value.c (unpack_bits_as_long): Rename to...
(unpack_value_bits_as_long_1): ... this. Add embedded_offset and
value parameters. Return the extracted result in a new output
parameter. If the value contents are unavailable, return false,
otherwise return true.
(unpack_value_bits_as_long): New.
(unpack_field_as_long): Rename to...
(unpack_value_field_as_long_1): ... this. Add embedded_offset and
Add embedded_offset and value parameters. Return the extracted
result in a new output parameter. If the value contents are
unavailable, return false, otherwise return true.
(unpack_value_field_as_long): New.
(unpack_field_as_long_1): New.
(unpack_field_as_long): Reimplement as wrapper around
unpack_value_field_as_long_1.
(value_field_bitfield): New function.
* valops.c (value_fetch_lazy): When fetching a bitfield, use
unpack_value_bits_as_long. Mark the value as unavailable, if it
is unavailable.
* jv-valprint.c (java_print_value_fields): Use
value_field_bitfield.
* p-valprint.c (pascal_object_print_value_fields): Use
value_field_bitfield.
* cp-valprint.c (cp_print_value_fields): Use value_field_bitfield.
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gdb/value.h b/gdb/value.h index 0feb92f..5bd48e0 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -430,11 +430,25 @@ 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 int unpack_value_bits_as_long (struct type *field_type, + const gdb_byte *valaddr, + int embedded_offset, int bitpos, + int bitsize, + const struct value *original_value, + LONGEST *result); + extern LONGEST unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno); +extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, + int embedded_offset, int fieldno, + const struct value *val, LONGEST *result); + +extern struct value *value_field_bitfield (struct type *type, int fieldno, + const gdb_byte *valaddr, + int embedded_offset, + const struct value *val); extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); |