aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-11-09 19:50:15 +0000
committerTom Tromey <tromey@redhat.com>2011-11-09 19:50:15 +0000
commita7860e76c92d8aea95640ce1a75822efeaed4f32 (patch)
treeaa25ec6272ee282de2055d1a395c6516a354a7db /gdb/valops.c
parentb121d7d4e41eebde43ebd368704897b7b1d96d6e (diff)
downloadgdb-a7860e76c92d8aea95640ce1a75822efeaed4f32.zip
gdb-a7860e76c92d8aea95640ce1a75822efeaed4f32.tar.gz
gdb-a7860e76c92d8aea95640ce1a75822efeaed4f32.tar.bz2
gdb
PR c++/13342: * valops.c (value_full_object): Return early if real type is smaller than the enclosing type. gdb/testsuite * gdb.cp/destrprint.exp: New file. * gdb.cp/destrprint.cc: New file.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index cb39677..29d1fbd 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3581,6 +3581,13 @@ value_full_object (struct value *argp,
if (!real_type || real_type == value_enclosing_type (argp))
return argp;
+ /* In a destructor we might see a real type that is a superclass of
+ the object's type. In this case it is better to leave the object
+ as-is. */
+ if (full
+ && TYPE_LENGTH (real_type) < TYPE_LENGTH (value_enclosing_type (argp)))
+ return argp;
+
/* If we have the full object, but for some reason the enclosing
type is wrong, set it. */
/* pai: FIXME -- sounds iffy */