}
else if (section_is_p (sectp->name, &names->eh_frame))
{
- flagword aflag = bfd_get_section_flags (ignore_abfd, sectp);
+ flagword aflag = bfd_get_section_flags (abfd, sectp);
if (aflag & SEC_HAS_CONTENTS)
{
struct line_header *lh;
struct attribute *attr;
int i;
- unsigned int bytes_read;
char *name, *comp_dir;
void **slot;
struct quick_file_names *qfn;
}
}
+/* A helper for dw2_find_pc_sect_symtab which finds the most specific
+ symtab. */
+
+static struct symtab *
+recursively_find_pc_sect_symtab (struct symtab *symtab, CORE_ADDR pc)
+{
+ int i;
+
+ if (BLOCKVECTOR (symtab) != NULL
+ && blockvector_contains_pc (BLOCKVECTOR (symtab), pc))
+ return symtab;
+
+ for (i = 0; symtab->includes[i]; ++i)
+ {
+ struct symtab *s;
+
+ s = recursively_find_pc_sect_symtab (s, pc);
+ if (s != NULL)
+ return s;
+ }
+
+ return NULL;
+}
+
static struct symtab *
dw2_find_pc_sect_symtab (struct objfile *objfile,
struct minimal_symbol *msymbol,
int warn_if_readin)
{
struct dwarf2_per_cu_data *data;
+ struct symtab *result;
dw2_setup (objfile);
warning (_("(Internal error: pc %s in read in CU, but not in symtab.)"),
paddress (get_objfile_arch (objfile), pc));
- return dw2_instantiate_symtab (data);
+ result = recursively_find_pc_sect_symtab (dw2_instantiate_symtab (data), pc);
+ gdb_assert (result != NULL);
+ return result;
}
static void
struct dwarf2_cu *cu = reader->cu;
struct objfile *objfile = cu->objfile;
struct dwarf2_per_cu_data *per_cu = cu->per_cu;
- bfd *abfd = objfile->obfd;
struct attribute *attr;
CORE_ADDR baseaddr;
CORE_ADDR best_lowpc = 0, best_highpc = 0;
psymtab_to_symtab_1 (struct partial_symtab *pst)
{
struct dwarf2_per_cu_data *per_cu;
- struct cleanup *back_to;
int i;
if (pst->readin)
void *data)
{
struct dwarf2_cu *cu = reader->cu;
- struct attribute *attr;
enum language *language_ptr = data;
gdb_assert (cu->die_hash == NULL);
bfd *sym_bfd;
int desc;
char *absolute_name;
- char *name;
desc = openp (debug_file_directory, OPF_TRY_CWD_FIRST, file_name,
O_RDONLY | O_BINARY, &absolute_name);
open_dwo_file (const char *dwo_name, const char *comp_dir)
{
bfd *abfd;
- char *path_to_try, *debug_dir;
if (IS_ABSOLUTE_PATH (dwo_name))
return try_open_dwo_file (dwo_name);
{
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwo_file *dwo_file;
- struct dwo_unit find_dwo_tu, *dwo_tu;
dwo_file = lookup_dwo_file (dwo_name, comp_dir);
if (dwo_file == NULL)
child_die && child_die->tag;
child_die = sibling_die (child_die))
{
- struct dwarf2_locexpr_baton *dlbaton;
struct call_site_parameter *parameter;
if (child_die->tag != DW_TAG_GNU_call_site_parameter)
void *data)
{
struct dwarf2_cu *cu = reader->cu;
- struct attribute *attr;
gdb_assert (cu->die_hash == NULL);
cu->die_hash =
objfile->macro_cache);
if (! current_file)
- /* If we have no current file, then this must be the start_file
- directive for the compilation unit's main source file. */
- current_file = macro_set_main (pending_macros, full_name);
+ {
+ /* If we have no current file, then this must be the start_file
+ directive for the compilation unit's main source file. */
+ current_file = macro_set_main (pending_macros, full_name);
+ macro_define_special (pending_macros);
+ }
else
current_file = macro_include (current_file, line, full_name);
{
struct addrmap_index_data *data = datap;
struct partial_symtab *pst = obj;
- offset_type cu_index;
- void **slot;
if (data->previous_valid)
add_address_entry (data->objfile, data->addr_obstack,
struct mapped_symtab *symtab;
offset_type val, size_of_contents, total_len;
struct stat st;
- char buf[8];
htab_t psyms_seen;
htab_t cu_index_htab;
struct psymtab_cu_index_map *psymtab_cu_index_map;