aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2025-02-08 12:43:21 -0700
committerTom Tromey <tom@tromey.com>2025-02-19 17:55:26 -0700
commite17e25351f1248cd791f54d17db6f81000301bec (patch)
tree0319b3e1366c108d65935cf3b5c91bf6da8eb81d /gdb
parent02fd6e5459e69f1bc4eb46df135ed3c3b5a396d1 (diff)
downloadbinutils-e17e25351f1248cd791f54d17db6f81000301bec.zip
binutils-e17e25351f1248cd791f54d17db6f81000301bec.tar.gz
binutils-e17e25351f1248cd791f54d17db6f81000301bec.tar.bz2
Clean up DW_TAG_namelist handling in new_symbol
In dwarf2/read.c:new_symbol, DW_TAG_namelist is listed in the same part of the "switch" as other tags. However, it effectively shares no code with these. This patch splits it into its own case. Longer term I think new_symbol should be split up drastically.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/read.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 4e30a56..475269d 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -18780,17 +18780,11 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
case DW_TAG_union_type:
case DW_TAG_set_type:
case DW_TAG_enumeration_type:
- case DW_TAG_namelist:
- if (die->tag == DW_TAG_namelist)
- {
- sym->set_aclass_index (LOC_STATIC);
- sym->set_domain (VAR_DOMAIN);
- }
- else if (cu->lang () == language_c
- || cu->lang () == language_cplus
- || cu->lang () == language_objc
- || cu->lang () == language_opencl
- || cu->lang () == language_minimal)
+ if (cu->lang () == language_c
+ || cu->lang () == language_cplus
+ || cu->lang () == language_objc
+ || cu->lang () == language_opencl
+ || cu->lang () == language_minimal)
{
/* These languages have a tag namespace. Note that
there's a special hack for C++ in the matching code,
@@ -18884,6 +18878,11 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
sym->set_domain (COMMON_BLOCK_DOMAIN);
list_to_add = cu->list_in_scope;
break;
+ case DW_TAG_namelist:
+ sym->set_aclass_index (LOC_STATIC);
+ sym->set_domain (VAR_DOMAIN);
+ list_to_add = cu->list_in_scope;
+ break;
default:
/* Not a tag we recognize. Hopefully we aren't processing
trash data, but since we must specifically ignore things