/* DWARF 2 debugging format support for GDB.
- Copyright (C) 1994-2013 Free Software Foundation, Inc.
+ Copyright (C) 1994-2014 Free Software Foundation, Inc.
Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,
Inc. with support from Florida State University (under contract
#include "jv-lang.h"
#include "psympriv.h"
#include "exceptions.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "completer.h"
#include "vec.h"
#include "c-lang.h"
&objfile->global_psymbols,
0, (CORE_ADDR) 0, cu->language, objfile);
break;
+ case DW_TAG_module:
+ add_psymbol_to_list (actual_name, strlen (actual_name),
+ built_actual_name != NULL,
+ MODULE_DOMAIN, LOC_TYPEDEF,
+ &objfile->global_psymbols,
+ 0, (CORE_ADDR) 0, cu->language, objfile);
+ break;
case DW_TAG_class_type:
case DW_TAG_interface_type:
case DW_TAG_structure_type:
add_partial_module (struct partial_die_info *pdi, CORE_ADDR *lowpc,
CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu)
{
+ /* Add a symbol for the namespace. */
+
+ add_partial_symbol (pdi, cu);
+
/* Now scan partial symbols in that module. */
if (pdi->has_children)
/* This is a warning and not a complaint because it can be caused by
pilot error (e.g., user accidentally deleting the DWO). */
- warning (_("Could not find DWO %s %s(%s) referenced by %s at offset 0x%x"
- " [in module %s]"),
- kind, dwo_name, hex_string (signature),
- this_unit->is_debug_types ? "TU" : "CU",
- this_unit->offset.sect_off, objfile_name (objfile));
+ {
+ /* Print the name of the DWP file if we looked there, helps the user
+ better diagnose the problem. */
+ char *dwp_text = NULL;
+ struct cleanup *cleanups;
+
+ if (dwp_file != NULL)
+ dwp_text = xstrprintf (" [in DWP file %s]", lbasename (dwp_file->name));
+ cleanups = make_cleanup (xfree, dwp_text);
+
+ warning (_("Could not find DWO %s %s(%s)%s referenced by %s at offset 0x%x"
+ " [in module %s]"),
+ kind, dwo_name, hex_string (signature),
+ dwp_text != NULL ? dwp_text : "",
+ this_unit->is_debug_types ? "TU" : "CU",
+ this_unit->offset.sect_off, objfile_name (objfile));
+
+ do_cleanups (cleanups);
+ }
return NULL;
}
read_module (struct die_info *die, struct dwarf2_cu *cu)
{
struct die_info *child_die = die->child;
+ struct type *type;
+
+ type = read_type_die (die, cu);
+ new_symbol (die, type, cu);
while (child_die && child_die->tag)
{
struct attr_abbrev *cur_attrs;
unsigned int allocated_attrs;
- abbrev_table = XMALLOC (struct abbrev_table);
+ abbrev_table = XNEW (struct abbrev_table);
abbrev_table->offset = offset;
obstack_init (&abbrev_table->abbrev_obstack);
abbrev_table->abbrevs = obstack_alloc (&abbrev_table->abbrev_obstack,
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
list_to_add = &global_symbols;
break;
+ case DW_TAG_module:
+ SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
+ SYMBOL_DOMAIN (sym) = MODULE_DOMAIN;
+ list_to_add = &global_symbols;
+ break;
case DW_TAG_common_block:
SYMBOL_ACLASS_INDEX (sym) = LOC_COMMON_BLOCK;
SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;