summaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorLuis Machado <luisgpm@br.ibm.com>2012-11-14 19:21:01 +0000
committerLuis Machado <luisgpm@br.ibm.com>2012-11-14 19:21:01 +0000
commitc683f0ab1ab3ce92c25b28540f396167eb761c2f (patch)
tree414ce98d3710865a3129b42d3ad968392bbadc10 /gdb/value.c
parent8474b44ee255ede85692726f03b1465eefed734a (diff)
downloadgdb-c683f0ab1ab3ce92c25b28540f396167eb761c2f.tar.gz
2012-11-14 Luis Machado <lgustavo@codesourcery.com>
gdb/ * value.c (value_actual_type): Check for TYPE_CODE_STRUCT target types. gdb/testsuite/ * gdb.mi/mi-var-create-rtti.c: New file. * gdb.mi/mi-var-create-rtti.exp: New file.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 3feb1ca5518..2a1e1f262d8 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -850,8 +850,12 @@ value_actual_type (struct value *value, int resolve_simple_types,
result = value_type (value);
if (opts.objectprint)
{
- if (TYPE_CODE (result) == TYPE_CODE_PTR
+ /* If result's target type is TYPE_CODE_STRUCT, proceed to
+ fetch its rtti type. */
+ if ((TYPE_CODE (result) == TYPE_CODE_PTR
|| TYPE_CODE (result) == TYPE_CODE_REF)
+ && TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (result)))
+ == TYPE_CODE_STRUCT)
{
struct type *real_type;