diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-04-03 14:39:55 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-04-03 14:39:55 +0000 |
commit | a72c8f6a2934a77223ba77f972f418ec40240d1d (patch) | |
tree | 96bb7e0935269309786f35c1449f69edc5f782ee /gdb/cp-valprint.c | |
parent | 23916fffce6bac40347fc5a061c9e073e462f943 (diff) | |
download | gdb-a72c8f6a2934a77223ba77f972f418ec40240d1d.zip gdb-a72c8f6a2934a77223ba77f972f418ec40240d1d.tar.gz gdb-a72c8f6a2934a77223ba77f972f418ec40240d1d.tar.bz2 |
gdb/
* cp-valprint.c (cp_print_value_fields): Check valprint_check_validity
for TYPE_VPTR_FIELDNO.
* valprint.c (valprint_check_validity): Make it global, move the
function comment ...
* value.h (valprint_check_validity): ... to this new declaration.
gdb/testsuite/
* gdb.trace/unavailable.exp
(collect globals: print object on: print derived_partial)
(collect globals: print object on: print derived_whole)
(collect globals: print object off: print derived_partial)
(collect globals: print object off: print derived_whole): Update
expected output.
Diffstat (limited to 'gdb/cp-valprint.c')
-rw-r--r-- | gdb/cp-valprint.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index cb85b0b..7dd13bb 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -360,14 +360,18 @@ cp_print_value_fields (struct type *type, struct type *real_type, } else if (i == TYPE_VPTR_FIELDNO (type)) { - CORE_ADDR addr - = extract_typed_address (valaddr + offset - + TYPE_FIELD_BITSIZE (type, i) / 8, - TYPE_FIELD_TYPE (type, i)); - - print_function_pointer_address (get_type_arch (type), - addr, stream, - options->addressprint); + int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; + struct type *i_type = TYPE_FIELD_TYPE (type, i); + + if (valprint_check_validity (stream, i_type, i_offset, val)) + { + CORE_ADDR addr; + + addr = extract_typed_address (valaddr + i_offset, i_type); + print_function_pointer_address (get_type_arch (type), + addr, stream, + options->addressprint); + } } else { |