Blame SOURCES/gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-4of5.patch

190f2a
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
190f2a
From: Sergio Durigan Junior <sergiodj@redhat.com>
190f2a
Date: Fri, 11 Jan 2019 11:29:25 -0500
190f2a
Subject: 
190f2a
 gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-4of5.patch
190f2a
190f2a
;; Fix 'Assertion `SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language' failed.'
190f2a
;; Keith Seitz, RHBZ#1560010.
190f2a
190f2a
gdb/23712: Remove dw2_add_symbol_to_list
190f2a
190f2a
Finally, we can remove dw2_add_symbol_to_list since the wrapper function
190f2a
originally introduced to catch this multi-language scenario is no longer
190f2a
needed.  With multi-language dictionaries, we can now support adding
190f2a
symbols of multiple languages, negating the need for the assertion
190f2a
entirely.
190f2a
190f2a
This patch should now fix gdb/23712 (and symtab/23010).  At least it will
190f2a
if the NULL buildsym_compunit problem doesn't strike first (see gdb/23773).
190f2a
190f2a
gdb/ChangeLog:
190f2a
190f2a
	PR gdb/23712
190f2a
	PR symtab/23010
190f2a
	* dwarf2read.c (dw2_add_symbol_to_list): Remove.
190f2a
	(fixup_go_packaging, new_symbol): Use add_symbol_to_list.
190f2a
190f2a
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
190f2a
--- a/gdb/dwarf2read.c
190f2a
+++ b/gdb/dwarf2read.c
190f2a
@@ -9715,23 +9715,6 @@ compute_delayed_physnames (struct dwarf2_cu *cu)
190f2a
   cu->method_list.clear ();
190f2a
 }
190f2a
 
190f2a
-/* A wrapper for add_symbol_to_list to ensure that SYMBOL's language is
190f2a
-   the same as all other symbols in LISTHEAD.  If a new symbol is added
190f2a
-   with a different language, this function asserts.  */
190f2a
-
190f2a
-static inline void
190f2a
-dw2_add_symbol_to_list (struct symbol *symbol, struct pending **listhead)
190f2a
-{
190f2a
-  /* Only assert if LISTHEAD already contains symbols of a different
190f2a
-     language (dict_create_hashed/insert_symbol_hashed requires that all
190f2a
-     symbols in this list are of the same language).  */
190f2a
-  gdb_assert ((*listhead) == NULL
190f2a
-	      || (SYMBOL_LANGUAGE ((*listhead)->symbol[0])
190f2a
-		  == SYMBOL_LANGUAGE (symbol)));
190f2a
-
190f2a
-  add_symbol_to_list (symbol, listhead);
190f2a
-}
190f2a
-
190f2a
 /* Go objects should be embedded in a DW_TAG_module DIE,
190f2a
    and it's not clear if/how imported objects will appear.
190f2a
    To keep Go support simple until that's worked out,
190f2a
@@ -9803,7 +9786,7 @@ fixup_go_packaging (struct dwarf2_cu *cu)
190f2a
       SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
190f2a
       SYMBOL_TYPE (sym) = type;
190f2a
 
190f2a
-      dw2_add_symbol_to_list (sym, &global_symbols);
190f2a
+      add_symbol_to_list (sym, &global_symbols);
190f2a
 
190f2a
       xfree (package_name);
190f2a
     }
190f2a
@@ -21387,7 +21370,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
190f2a
 	  SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_core_addr;
190f2a
 	  SYMBOL_DOMAIN (sym) = LABEL_DOMAIN;
190f2a
 	  SYMBOL_ACLASS_INDEX (sym) = LOC_LABEL;
190f2a
-	  dw2_add_symbol_to_list (sym, cu->list_in_scope);
190f2a
+	  add_symbol_to_list (sym, cu->list_in_scope);
190f2a
 	  break;
190f2a
 	case DW_TAG_subprogram:
190f2a
 	  /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
190f2a
@@ -21645,7 +21628,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
190f2a
 	case DW_TAG_common_block:
190f2a
 	  SYMBOL_ACLASS_INDEX (sym) = LOC_COMMON_BLOCK;
190f2a
 	  SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;
190f2a
-	  dw2_add_symbol_to_list (sym, cu->list_in_scope);
190f2a
+	  add_symbol_to_list (sym, cu->list_in_scope);
190f2a
 	  break;
190f2a
 	default:
190f2a
 	  /* Not a tag we recognize.  Hopefully we aren't processing
190f2a
@@ -21665,7 +21648,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
190f2a
 	}
190f2a
 
190f2a
       if (list_to_add != NULL)
190f2a
-	dw2_add_symbol_to_list (sym, list_to_add);
190f2a
+	add_symbol_to_list (sym, list_to_add);
190f2a
 
190f2a
       /* For the benefit of old versions of GCC, check for anonymous
190f2a
 	 namespaces based on the demangled name.  */