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,
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
SYMBOL_TYPE (sym) = type;
- add_symbol_to_list (sym, cu->builder->get_global_symbols ());
+ dw2_add_symbol_to_list (sym, cu->builder->get_global_symbols ());
xfree (package_name);
}
struct die_info *child_die;
CORE_ADDR baseaddr;
+ prepare_one_comp_unit (cu, die, cu->language);
baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
get_scope_pc_bounds (die, &lowpc, &highpc, cu);
file_and_directory fnd = find_file_and_directory (die, cu);
- prepare_one_comp_unit (cu, die, cu->language);
-
/* The XLCL doesn't generate DW_LANG_OpenCL because this attribute is not
standardised yet. As a workaround for the language detection we fall
back to the DW_AT_producer string. */
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_core_addr;
SYMBOL_DOMAIN (sym) = LABEL_DOMAIN;
SYMBOL_ACLASS_INDEX (sym) = LOC_LABEL;
- add_symbol_to_list (sym, cu->list_in_scope);
+ dw2_add_symbol_to_list (sym, cu->list_in_scope);
break;
case DW_TAG_subprogram:
/* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
case DW_TAG_common_block:
SYMBOL_ACLASS_INDEX (sym) = LOC_COMMON_BLOCK;
SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;
- add_symbol_to_list (sym, cu->list_in_scope);
+ dw2_add_symbol_to_list (sym, cu->list_in_scope);
break;
default:
/* Not a tag we recognize. Hopefully we aren't processing
}
if (list_to_add != NULL)
- add_symbol_to_list (sym, list_to_add);
+ dw2_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. */