aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1995-09-27 18:47:22 +0000
committerPer Bothner <per@bothner.com>1995-09-27 18:47:22 +0000
commit4c2260aa5c261f7bfb26dcf3aa7c67876720b17e (patch)
tree86f33728b080a270aa4ff0d53cb6e3800c26ba2e /gdb/valops.c
parent1293a6fc03f13a929b5c8b18526ad6d4aca85ee4 (diff)
downloadgdb-4c2260aa5c261f7bfb26dcf3aa7c67876720b17e.zip
gdb-4c2260aa5c261f7bfb26dcf3aa7c67876720b17e.tar.gz
gdb-4c2260aa5c261f7bfb26dcf3aa7c67876720b17e.tar.bz2
* valops.c (search_struct_field): Also allow "else" as a variant name,
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 46a22a2..b4bfde8 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1536,7 +1536,10 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
return v;
}
- if (t_field_name && t_field_name[0] == '\0')
+ if (t_field_name
+ && (t_field_name[0] == '\0'
+ || (TYPE_CODE (type) == TYPE_CODE_UNION
+ && STREQ (t_field_name, "else"))))
{
struct type *field_type = TYPE_FIELD_TYPE (type, i);
if (TYPE_CODE (field_type) == TYPE_CODE_UNION