diff options
author | Tom Tromey <tromey@redhat.com> | 2008-10-30 21:44:15 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2008-10-30 21:44:15 +0000 |
commit | f3134b888619774c6511acbf8d978bd7427ce1ad (patch) | |
tree | fecd95fd6c571f6a6d6bad373e635a6d9cdb068a /gdb/value.c | |
parent | 724b958c4168d40f59a35112c36ebf9e02c43d56 (diff) | |
download | gdb-f3134b888619774c6511acbf8d978bd7427ce1ad.zip gdb-f3134b888619774c6511acbf8d978bd7427ce1ad.tar.gz gdb-f3134b888619774c6511acbf8d978bd7427ce1ad.tar.bz2 |
gdb
* value.c (coerce_array): Use check_typedef.
gdb/testsuite
* gdb.base/pointers.exp: Add test.
* gdb.base/pointers.c (k, S): New typedefs.
(instance): New global.
Diffstat (limited to 'gdb/value.c')
-rw-r--r-- | gdb/value.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gdb/value.c b/gdb/value.c index 1fa376d..695aa33 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1728,12 +1728,21 @@ coerce_ref (struct value *arg) struct value * coerce_array (struct value *arg) { + struct type *type; + arg = coerce_ref (arg); - if (current_language->c_style_arrays - && TYPE_CODE (value_type (arg)) == TYPE_CODE_ARRAY) - arg = value_coerce_array (arg); - if (TYPE_CODE (value_type (arg)) == TYPE_CODE_FUNC) - arg = value_coerce_function (arg); + type = check_typedef (value_type (arg)); + + switch (TYPE_CODE (type)) + { + case TYPE_CODE_ARRAY: + if (current_language->c_style_arrays) + arg = value_coerce_array (arg); + break; + case TYPE_CODE_FUNC: + arg = value_coerce_function (arg); + break; + } return arg; } |