aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index db84f4f..1a0dcba 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -705,8 +705,11 @@ init_sal (struct symtab_and_line *sal)
file and another in a separated debug file. */
int
-matching_bfd_sections (asection *first, asection *second)
+matching_obj_sections (struct obj_section *obj_first,
+ struct obj_section *obj_second)
{
+ asection *first = obj_first? obj_first->the_bfd_section : NULL;
+ asection *second = obj_second? obj_second->the_bfd_section : NULL;
struct objfile *obj;
/* If they're the same section, then they match. */
@@ -766,7 +769,7 @@ matching_bfd_sections (asection *first, asection *second)
We may find a different psymtab than PST. See FIND_PC_SECT_PSYMTAB. */
struct partial_symtab *
-find_pc_sect_psymtab_closer (CORE_ADDR pc, asection *section,
+find_pc_sect_psymtab_closer (CORE_ADDR pc, struct obj_section *section,
struct partial_symtab *pst,
struct minimal_symbol *msymbol)
{
@@ -844,7 +847,7 @@ find_pc_sect_psymtab_closer (CORE_ADDR pc, asection *section,
exactly matches PC, or, if we cannot find an exact match, the
psymtab that contains a symbol whose address is closest to PC. */
struct partial_symtab *
-find_pc_sect_psymtab (CORE_ADDR pc, asection *section)
+find_pc_sect_psymtab (CORE_ADDR pc, struct obj_section *section)
{
struct objfile *objfile;
struct minimal_symbol *msymbol;
@@ -941,7 +944,7 @@ find_pc_psymtab (CORE_ADDR pc)
struct partial_symbol *
find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc,
- asection *section)
+ struct obj_section *section)
{
struct partial_symbol *best = NULL, *p, **pp;
CORE_ADDR best_pc;
@@ -973,7 +976,7 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc,
if (section) /* match on a specific section */
{
fixup_psymbol_section (p, psymtab->objfile);
- if (!matching_bfd_sections (SYMBOL_BFD_SECTION (p), section))
+ if (!matching_obj_sections (SYMBOL_OBJ_SECTION (p), section))
continue;
}
best_pc = SYMBOL_VALUE_ADDRESS (p);
@@ -997,7 +1000,7 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc,
if (section) /* match on a specific section */
{
fixup_psymbol_section (p, psymtab->objfile);
- if (!matching_bfd_sections (SYMBOL_BFD_SECTION (p), section))
+ if (!matching_obj_sections (SYMBOL_OBJ_SECTION (p), section))
continue;
}
best_pc = SYMBOL_VALUE_ADDRESS (p);
@@ -1034,7 +1037,7 @@ fixup_section (struct general_symbol_info *ginfo,
msym = lookup_minimal_symbol_by_pc_name (addr, ginfo->name, objfile);
if (msym)
{
- ginfo->bfd_section = SYMBOL_BFD_SECTION (msym);
+ ginfo->obj_section = SYMBOL_OBJ_SECTION (msym);
ginfo->section = SYMBOL_SECTION (msym);
}
else
@@ -1084,7 +1087,7 @@ fixup_section (struct general_symbol_info *ginfo,
if (obj_section_addr (s) - offset <= addr
&& addr < obj_section_endaddr (s) - offset)
{
- ginfo->bfd_section = s->the_bfd_section;
+ ginfo->obj_section = s;
ginfo->section = idx;
return;
}
@@ -1100,7 +1103,7 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile)
if (!sym)
return NULL;
- if (SYMBOL_BFD_SECTION (sym))
+ if (SYMBOL_OBJ_SECTION (sym))
return sym;
/* We either have an OBJFILE, or we can get at it from the sym's
@@ -1142,7 +1145,7 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
if (!psym)
return NULL;
- if (SYMBOL_BFD_SECTION (psym))
+ if (SYMBOL_OBJ_SECTION (psym))
return psym;
gdb_assert (objfile);
@@ -1970,7 +1973,7 @@ lookup_block_symbol (const struct block *block, const char *name,
psymtabs and read in another symtab if necessary. */
struct symtab *
-find_pc_sect_symtab (CORE_ADDR pc, asection *section)
+find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
{
struct block *b;
struct blockvector *bv;
@@ -2040,7 +2043,7 @@ find_pc_sect_symtab (CORE_ADDR pc, asection *section)
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
fixup_symbol_section (sym, objfile);
- if (matching_bfd_sections (SYMBOL_BFD_SECTION (sym), section))
+ if (matching_obj_sections (SYMBOL_OBJ_SECTION (sym), section))
break;
}
if (sym == NULL)
@@ -2098,7 +2101,7 @@ find_pc_symtab (CORE_ADDR pc)
/* If it's worth the effort, we could be using a binary search. */
struct symtab_and_line
-find_pc_sect_line (CORE_ADDR pc, struct bfd_section *section, int notcurrent)
+find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
{
struct symtab *s;
struct linetable *l;
@@ -2335,7 +2338,7 @@ find_pc_sect_line (CORE_ADDR pc, struct bfd_section *section, int notcurrent)
struct symtab_and_line
find_pc_line (CORE_ADDR pc, int notcurrent)
{
- asection *section;
+ struct obj_section *section;
section = find_pc_overlay (pc);
if (pc_in_unmapped_range (pc, section))
@@ -2567,7 +2570,7 @@ find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
address after the function prologue. */
CORE_ADDR
find_function_start_pc (struct gdbarch *gdbarch,
- CORE_ADDR pc, asection *section)
+ CORE_ADDR pc, struct obj_section *section)
{
/* If the function is in an unmapped overlay, use its unmapped LMA address,
so that gdbarch_skip_prologue has something unique to work on. */
@@ -2603,9 +2606,9 @@ find_function_start_sal (struct symbol *sym, int funfirstline)
if (funfirstline)
{
/* Skip "first line" of function (which is actually its prologue). */
- pc = find_function_start_pc (gdbarch, pc, SYMBOL_BFD_SECTION (sym));
+ pc = find_function_start_pc (gdbarch, pc, SYMBOL_OBJ_SECTION (sym));
}
- sal = find_pc_sect_line (pc, SYMBOL_BFD_SECTION (sym), 0);
+ sal = find_pc_sect_line (pc, SYMBOL_OBJ_SECTION (sym), 0);
/* Check if gdbarch_skip_prologue left us in mid-line, and the next
line is still part of the same function. */
@@ -2616,7 +2619,7 @@ find_function_start_sal (struct symbol *sym, int funfirstline)
/* First pc of next line */
pc = sal.end;
/* Recalculate the line number (might not be N+1). */
- sal = find_pc_sect_line (pc, SYMBOL_BFD_SECTION (sym), 0);
+ sal = find_pc_sect_line (pc, SYMBOL_OBJ_SECTION (sym), 0);
}
/* On targets with executable formats that don't have a concept of
@@ -2630,7 +2633,7 @@ find_function_start_sal (struct symbol *sym, int funfirstline)
{
pc = gdbarch_skip_main_prologue (current_gdbarch, pc);
/* Recalculate the line number (might not be N+1). */
- sal = find_pc_sect_line (pc, SYMBOL_BFD_SECTION (sym), 0);
+ sal = find_pc_sect_line (pc, SYMBOL_OBJ_SECTION (sym), 0);
}
sal.pc = pc;