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

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