From: Tom Tromey Date: Sat, 8 Feb 2025 19:43:21 +0000 (-0700) Subject: Clean up DW_TAG_namelist handling in new_symbol X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e17e25351f1248cd791f54d17db6f81000301bec;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 4e30a5665c6..475269dad57 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