diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2008-09-05 11:37:18 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2008-09-05 11:37:18 +0000 |
commit | 714835d5a63b86bb0e82c13d2a4840d8b5e633d3 (patch) | |
tree | 7c84b75c6ae819733cc44c04a6b3d3e9bef9ce08 /gdb/symtab.c | |
parent | f91609ee709c69acbeafdd7000a70a7b63579ee3 (diff) | |
download | gdb-714835d5a63b86bb0e82c13d2a4840d8b5e633d3.zip gdb-714835d5a63b86bb0e82c13d2a4840d8b5e633d3.tar.gz gdb-714835d5a63b86bb0e82c13d2a4840d8b5e633d3.tar.bz2 |
* breakpoint.h (struct bp_location): Change type of section
member to "struct obj_section *".
* tracepoint.h (struct tracepoint): Likewise.
* symtab.h (struct general_symbol_info): Replace bfd_section
member with obj_section.
(struct symtab_and_line): Change type of section member to
"struct obj_section *".
(SYMBOL_BFD_SECTION): Remove macro, replace by ...
(SYMBOL_OBJ_SECTION): ... this.
* minsym.c (prim_record_minimal_symbol_and_info): Record symbol
section as obj_section instead of bfd_section.
* ada-lang.c (ada_decode_symbol): Use gsymbol->obj_section
directly instead of looking of obj_section from bfd_section.
* objfiles.h (find_pc_sect_section): Remove.
* objfiles.c (find_pc_sect_section): Remove.
(find_pc_section): Inline find_pc_sect_section code.
* symfile.h (find_pc_overlay): Return struct obj_section *.
(find_pc_mapped_section): Likewise.
(section_is_overlay, section_is_mapped): Change type of section
argument to struct obj_section *.
(pc_in_mapped_range, pc_in_unmapped_range): Likewise.
(overlay_mapped_address, overlay_unmapped_address): Likewise.
(symbol_overlayed_address): Likewise.
* symtab.h (symbol_overlayed_address): Likewise.
* symfile.c (overlay_is_mapped): Remove.
(section_is_mapped): Inline overlay_is_mapped code. Update.
(overlay_invalidate_all): Update.
(section_is_overlay): Change section argument to type
"struct obj_section *". Use bfd_ methods.
(pc_in_unmapped_range): Likewise. Handle relocated sections.
(pc_in_mapped_range): Likewise. Handle relocated sections.
(sections_overlap): Likewise.
(overlay_unmapped_address): Likewise.
(overlay_mapped_address): Likewise.
(symbol_overlayed_address): Likewise.
(find_pc_overlay): Return struct obj_section *.
(find_pc_mapped_section): Likewise.
(list_overlays_command): Update.
(map_overlay_command, unmap_overlay_command): Update.
(simple_overlay_update): Update.
* block.h (blockvector_for_pc_sect): Change section argument
to type "struct obj_section *".
(block_for_pc_sect): Likewise.
* block.c (blockvector_for_pc_sect): Change section argument
to type "struct obj_section *".
(block_for_pc_sect): Likewise.
* symtab.h (find_pc_sect_function, find_pc_sect_psymtab,
find_pc_sect_symtab, find_pc_sect_psymbol, find_pc_sect_line,
lookup_minimal_symbol_by_pc_section, find_function_start_pc): Likewise.
(matching_bfd_sections): Rename to ...
(matching_obj_sections): ... this. Update argument types.
* blockframe.c (find_pc_sect_function): Likewise.
* breakpoint.c (describe_other_breakpoints): Likewise.
(breakpoint_has_pc, check_duplicates_for): Likewise.
* minsyms.c (lookup_minimal_symbol_by_pc_section_1): Likewise.
(lookup_minimal_symbol_by_pc_section): Likewise.
* symtab.c (find_pc_sect_psymtab_closer): Likewise.
(find_pc_sect_psymtab, find_pc_sect_psymbol, find_pc_sect_symtab,
find_pc_sect_line, find_function_start_pc): Likewise.
(matching_bfd_sections): Rename to ...
(matching_obj_sections): ... this. Update argument types.
* blockframe.c (find_pc_partial_function): Update to section
type changes. No longer call find_pc_sect_section.
(cache_pc_function_section): Change to type "struct obj_section *".
* breakpoint.c (resolve_sal_pc): Update to section type changes.
* exec.c (xfer_memory): Likewise.
* findvar.c (read_var_value): Likewise.
* infcmd.c (jump_command): Likewise.
* linespec.c (minsym_found): Likewise.
* maint.c (maintenance_translate_address): Likewise.
* minsyms.c (lookup_minimal_symbol_by_pc_section_1): Likewise.
(lookup_solib_trampoline_symbol_by_pc): Likewise.
* parse.c (write_exp_msymbol): Likewise.
* printcmd.c (build_address_symbolic): Likewise.
(address_info, sym_info): Likewise.
* symmisc.c (dump_msymbols, print_symbol): Likewise.
* symtab.c (fixup_section): Likewise.
(fixup_symbol_section, fixup_psymbol_section): Likewise.
(find_pc_line, find_function_start_sal): Likewise.
* target.c (memory_xfer_partial): Likewise.
* hppa-hpux-tdep.c (hppa64_hpux_in_solib_call_trampoline): Likewise.
* spu-tdep.c (spu_overlay_update): Likewise.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 41 |
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; |