diff options
author | Luis Machado <luisgpm@br.ibm.com> | 2012-11-14 19:21:01 +0000 |
---|---|---|
committer | Luis Machado <luisgpm@br.ibm.com> | 2012-11-14 19:21:01 +0000 |
commit | 5e34c6c3f06f9a0b76520221f8417e08c4da98e7 (patch) | |
tree | 3a1b1d03163b9e7daa4b91199b8ddc8a310d6d4d /gdb/value.c | |
parent | e68227b9073ac89fa9e39578dc14fcada50d4f79 (diff) | |
download | gdb-5e34c6c3f06f9a0b76520221f8417e08c4da98e7.zip gdb-5e34c6c3f06f9a0b76520221f8417e08c4da98e7.tar.gz gdb-5e34c6c3f06f9a0b76520221f8417e08c4da98e7.tar.bz2 |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/value.c b/gdb/value.c index 3feb1ca..2a1e1f2 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; |