diff options
author | Keith Seitz <keiths@redhat.com> | 2019-01-10 13:57:08 -0800 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2019-01-10 13:57:08 -0800 |
commit | d3cb68081112a4976979df3f8eae7ca926e76519 (patch) | |
tree | 584ec355dc0d8dd9e8ae16993da026c6a8a37127 | |
parent | 63a20375b401e24c30987367a10b47b289612e1c (diff) | |
download | gdb-d3cb68081112a4976979df3f8eae7ca926e76519.zip gdb-d3cb68081112a4976979df3f8eae7ca926e76519.tar.gz gdb-d3cb68081112a4976979df3f8eae7ca926e76519.tar.bz2 |
gdb/23712: Remove dw2_add_symbol_to_list
Finally, we can remove dw2_add_symbol_to_list since the wrapper function
originally introduced to catch this multi-language scenario is no longer
needed. With multi-language dictionaries, we can now support adding
symbols of multiple languages, negating the need for the assertion
entirely.
This patch should now fix gdb/23712 (and symtab/23010). At least it will
if the NULL buildsym_compunit problem doesn't strike first (see gdb/23773).
gdb/ChangeLog:
PR gdb/23712
PR symtab/23010
* dwarf2read.c (dw2_add_symbol_to_list): Remove.
(fixup_go_packaging, new_symbol): Use add_symbol_to_list.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 25 |
2 files changed, 11 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 092534b..01c0bcc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -2,6 +2,13 @@ PR gdb/23712 PR symtab/23010 + * dwarf2read.c (dw2_add_symbol_to_list): Remove. + (fixup_go_packaging, new_symbol): Use add_symbol_to_list. + +2019-01-10 Keith Seitz <keiths@redhat.com> + + PR gdb/23712 + PR symtab/23010 * dictionary.c (pending_to_vector): Remove. (dict_create_hashed_1, dict_create_linear_1, dict_add_pending_1): Remove _1 suffix, replacing functions of the same name. Update diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 7546c48..43be223 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -9779,23 +9779,6 @@ compute_delayed_physnames (struct dwarf2_cu *cu) cu->method_list.clear (); } -/* A wrapper for add_symbol_to_list to ensure that SYMBOL's language is - the same as all other symbols in LISTHEAD. If a new symbol is added - with a different language, this function asserts. */ - -static inline void -dw2_add_symbol_to_list (struct symbol *symbol, struct pending **listhead) -{ - /* Only assert if LISTHEAD already contains symbols of a different - language (dict_create_hashed/insert_symbol_hashed requires that all - symbols in this list are of the same language). */ - gdb_assert ((*listhead) == NULL - || (SYMBOL_LANGUAGE ((*listhead)->symbol[0]) - == SYMBOL_LANGUAGE (symbol))); - - add_symbol_to_list (symbol, listhead); -} - /* Go objects should be embedded in a DW_TAG_module DIE, and it's not clear if/how imported objects will appear. To keep Go support simple until that's worked out, @@ -9869,7 +9852,7 @@ fixup_go_packaging (struct dwarf2_cu *cu) SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF; SYMBOL_TYPE (sym) = type; - dw2_add_symbol_to_list (sym, cu->builder->get_global_symbols ()); + add_symbol_to_list (sym, cu->builder->get_global_symbols ()); xfree (package_name); } @@ -21428,7 +21411,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_core_addr; SYMBOL_DOMAIN (sym) = LABEL_DOMAIN; SYMBOL_ACLASS_INDEX (sym) = LOC_LABEL; - dw2_add_symbol_to_list (sym, cu->list_in_scope); + add_symbol_to_list (sym, cu->list_in_scope); break; case DW_TAG_subprogram: /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by @@ -21697,7 +21680,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, case DW_TAG_common_block: SYMBOL_ACLASS_INDEX (sym) = LOC_COMMON_BLOCK; SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN; - dw2_add_symbol_to_list (sym, cu->list_in_scope); + add_symbol_to_list (sym, cu->list_in_scope); break; default: /* Not a tag we recognize. Hopefully we aren't processing @@ -21717,7 +21700,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, } if (list_to_add != NULL) - dw2_add_symbol_to_list (sym, list_to_add); + add_symbol_to_list (sym, list_to_add); /* For the benefit of old versions of GCC, check for anonymous namespaces based on the demangled name. */ |