diff options
author | Daniel Jacobowitz <dan@debian.org> | 2003-06-19 20:40:40 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2003-06-19 20:40:40 +0000 |
commit | 1887dc01a49df4e77adc86ff25807a003cfead44 (patch) | |
tree | 445b0279308f41a2ebf250998649e29f5977e777 /gdb/varobj.c | |
parent | a927a95ba579acb4704de04c84fc46059aada76d (diff) | |
download | gdb-1887dc01a49df4e77adc86ff25807a003cfead44.tar.gz |
* varobj.c (get_type, get_target_type): Use check_typedef.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r-- | gdb/varobj.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c index 0c9f0484268..1c5fc6382f5 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1379,9 +1379,8 @@ make_cleanup_free_variable (struct varobj *var) return make_cleanup (do_free_variable_cleanup, var); } -/* This returns the type of the variable. This skips past typedefs - and returns the real type of the variable. It also dereferences - pointers and references. +/* This returns the type of the variable. It also skips past typedefs + to return the real type of the variable. NOTE: TYPE_TARGET_TYPE should NOT be used anywhere in this file except within get_target_type and get_type. */ @@ -1391,8 +1390,8 @@ get_type (struct varobj *var) struct type *type; type = var->type; - while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF) - type = TYPE_TARGET_TYPE (type); + if (type != NULL) + type = check_typedef (type); return type; } @@ -1423,8 +1422,8 @@ get_target_type (struct type *type) if (type != NULL) { type = TYPE_TARGET_TYPE (type); - while (type != NULL && TYPE_CODE (type) == TYPE_CODE_TYPEDEF) - type = TYPE_TARGET_TYPE (type); + if (type != NULL) + type = check_typedef (type); } return type; |