diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-04-03 14:39:51 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-04-03 14:39:51 +0000 |
commit | 2427aa4bd15e88a2aba5fe710c7425c4957f1819 (patch) | |
tree | fe33d174804e2dc254d13a2e0c1cefa20d2c1eb7 /gdb/cp-valprint.c | |
parent | 164d8e9ac9ec74d970aa42550000539710e96a8e (diff) | |
download | gdb-2427aa4bd15e88a2aba5fe710c7425c4957f1819.tar.gz |
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 cb85b0b18bc..7dd13bbfcec 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 { |