aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1993-12-21 22:22:45 +0000
committerPer Bothner <per@bothner.com>1993-12-21 22:22:45 +0000
commit852b3831ce3d1ecd88c18af36c54091aaa74a375 (patch)
tree36d53e44f5df7b919f7c08d00658300c8caa1e25 /gdb
parentcba009211a9e13e8c773c30fb35dd8ef61477554 (diff)
downloadgdb-852b3831ce3d1ecd88c18af36c54091aaa74a375.zip
gdb-852b3831ce3d1ecd88c18af36c54091aaa74a375.tar.gz
gdb-852b3831ce3d1ecd88c18af36c54091aaa74a375.tar.bz2
* valops.c (value_coerce_array): Handle STRINGs as well as ARRAYs.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/valops.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index cd42bdd..0ec5260 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -595,7 +595,8 @@ value_coerce_array (arg1)
error ("Attempt to take address of value not located in memory.");
/* Get type of elements. */
- if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_ARRAY)
+ if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_ARRAY
+ || TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_STRING)
type = TYPE_TARGET_TYPE (VALUE_TYPE (arg1));
else
/* A phony array made by value_repeat.
@@ -1747,7 +1748,19 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
for (i = TYPE_NFN_FIELDS (t) - 1; i >= 0; --i)
{
- if (STREQ (TYPE_FN_FIELDLIST_NAME (t, i), name))
+ char *t_field_name = TYPE_FN_FIELDLIST_NAME (t, i);
+ char dem_opname[64];
+
+ if (strncmp(t_field_name, "__", 2)==0 ||
+ strncmp(t_field_name, "op", 2)==0 ||
+ strncmp(t_field_name, "type", 4)==0 )
+ {
+ if (cplus_demangle_opname(t_field_name, dem_opname, DMGL_ANSI))
+ t_field_name = dem_opname;
+ else if (cplus_demangle_opname(t_field_name, dem_opname, 0))
+ t_field_name = dem_opname;
+ }
+ if (t_field_name && STREQ (t_field_name, name))
{
int j = TYPE_FN_FIELDLIST_LENGTH (t, i);
struct fn_field *f = TYPE_FN_FIELDLIST1 (t, i);