From patchwork Fri Nov 9 02:28:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 30086 Received: (qmail 86053 invoked by alias); 9 Nov 2018 02:28:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 86015 invoked by uid 89); 9 Nov 2018 02:28:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=23712, keith, symbol_language, 23010 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Nov 2018 02:28:51 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5757A8E5A4 for ; Fri, 9 Nov 2018 02:28:50 +0000 (UTC) Received: from theo.uglyboxes.com.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 212F55D783 for ; Fri, 9 Nov 2018 02:28:50 +0000 (UTC) From: Keith Seitz To: gdb-patches@sourceware.org Subject: [PATCH 4/5] gdb/23712: Remove dw2_add_symbol_to_list Date: Thu, 8 Nov 2018 18:28:46 -0800 Message-Id: <20181109022847.32049-4-keiths@redhat.com> In-Reply-To: <20181109022847.32049-1-keiths@redhat.com> References: <20181109022847.32049-1-keiths@redhat.com> X-IsSubscribed: yes 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 * dwarf2read.c (dw2_add_symbol_to_list): Remove. (fixup_go_packaging, new_symbol): Use add_symbol_to_list. --- gdb/ChangeLog | 6 ++++++ gdb/dwarf2read.c | 25 ++++--------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 32c58ed1e1..0534f7843a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +YYYY-MM-DD Keith Seitz + + PR gdb/23712 + * dwarf2read.c (dw2_add_symbol_to_list): Remove. + (fixup_go_packaging, new_symbol): Use add_symbol_to_list. + YYYY-MM-DD Keith Seitz PR gdb/23712 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index d2a8cd44f9..e0676d7777 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -9788,23 +9788,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, @@ -9878,7 +9861,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); } @@ -21437,7 +21420,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 @@ -21706,7 +21689,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 @@ -21726,7 +21709,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. */