aboutsummaryrefslogtreecommitdiff
path: root/gdb/psympriv.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-03 16:36:21 -0600
committerTom Tromey <tom@tromey.com>2018-07-26 09:18:31 -0600
commit7974897237f7708d440c45bc74cdfb70a2db8124 (patch)
treebe125266c70e1b0f8595874080bfedad1b971687 /gdb/psympriv.h
parent52948f01e4a11f5fcebdca112036f907ac69e7ad (diff)
downloadfsf-binutils-gdb-7974897237f7708d440c45bc74cdfb70a2db8124.zip
fsf-binutils-gdb-7974897237f7708d440c45bc74cdfb70a2db8124.tar.gz
fsf-binutils-gdb-7974897237f7708d440c45bc74cdfb70a2db8124.tar.bz2
Make psymbols and psymtabs independent of the program space
This patch finally makes partial symbols and partial symtabs independent of the program space. Specifically: It changes add_psymbol_to_list to accept a section index, and changes the psymbol readers to pass this. At the same time it removes the code to add the objfile's section offset to the psymbol. It adds an objfile argument to the psymtab textlow and texthigh accessors and changes some code to use the raw variants instead. It removes the "relocate" method from struct quick_symbol_functions, as it is no longer needed any more. It changes partial_symbol::address so that the relevant offset is now applied at the point of use. gdb/ChangeLog 2018-07-26 Tom Tromey <tom@tromey.com> * dwarf-index-write.c (add_address_entry): Don't add objfile offsets. * dbxread.c (find_stab_function): Rename from find_stab_function_addr. Return a bound_minimal_symbol. (read_dbx_symtab): Use raw_text_low, raw_text_high. Don't add objfile offsets. (end_psymtab): Use raw_text_low, raw_text_high, MSYMBOL_VALUE_RAW_ADDRESS. (read_ofile_symtab): Update. (process_one_symbol): Update. * dwarf2read.c (create_addrmap_from_index): Don't add objfile offsets. (dw2_relocate): Remove. (dw2_find_pc_sect_symtab): Bias PC by the text offset before searching addrmap. (dwarf2_gdb_index_functions, dwarf2_debug_names_functions): Update. (process_psymtab_comp_unit_reader, add_partial_symbol) (add_partial_subprogram, dwarf2_ranges_read): Update. (load_partial_dies): Update. (add_address_entry): Don't add objfile offsets. (dwarf2_build_include_psymtabs): Update. (create_addrmap_from_aranges): Don't add objfile offsets. (dw2_find_pc_sect_compunit_symtab): Update. * mdebugread.c (parse_symbol): Don't add objfile offsets. (parse_lines): Remove 'pst' parameter, replace with 'textlow'. Update. (parse_partial_symbols): Don't add objfile offsets. Use raw_text_low, raw_text_high. Update. (handle_psymbol_enumerators, psymtab_to_symtab_1): Update. * objfiles.c (objfile_relocate1): Don't relocate psymtabs_addrmap or call 'relocate' quick function. Clear psymbol_map. * psympriv.h (struct partial_symbol) <address>: Add section offset. <set_unrelocated_address>: Rename from set_address. <raw_text_low, raw_text_high>: New methods. <text_low, text_high>: Add objfile parameter. (add_psymbol_to_bcache): Add 'section' parameter. Call set_unrelocated_address. * psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymtab) (find_pc_psymbol): Update. (fixup_psymbol_section, relocate_psymtabs): Remove. (dump_psymtab, psym_functions): Update. (add_psymbol_to_bcache, add_psymbol_to_list): Add 'section' parameter. (maintenance_info_psymtabs, maintenance_check_psymtabs): Update. (start_psymtab_common): Update. * symfile-debug.c (debug_qf_relocate): Remove. (debug_sym_quick_functions): Update. * symfile.h (struct quick_symbol_functions) <relocate>: Remove. * xcoffread.c (scan_xcoff_symtab): Don't add objfile offsets. Update.
Diffstat (limited to 'gdb/psympriv.h')
-rw-r--r--gdb/psympriv.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index b3bda82..f8eade7 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -54,12 +54,12 @@ struct partial_symbol : public general_symbol_info
the offsets provided in OBJFILE. */
CORE_ADDR address (const struct objfile *objfile) const
{
- return value.address;
+ return value.address + ANOFFSET (objfile->section_offsets, section);
}
/* Set the address of this partial symbol. The address must be
unrelocated. */
- void set_address (CORE_ADDR addr)
+ void set_unrelocated_address (CORE_ADDR addr)
{
value.address = addr;
}
@@ -98,18 +98,32 @@ enum psymtab_search_status
struct partial_symtab
{
- /* Return the low text address of this partial_symtab. */
- CORE_ADDR text_low () const
+ /* Return the raw low text address of this partial_symtab. */
+ CORE_ADDR raw_text_low () const
{
return m_text_low;
}
- /* Return the high text address of this partial_symtab. */
- CORE_ADDR text_high () const
+ /* Return the raw high text address of this partial_symtab. */
+ CORE_ADDR raw_text_high () const
{
return m_text_high;
}
+ /* Return the relocated low text address of this partial_symtab. */
+ CORE_ADDR text_low (struct objfile *objfile) const
+ {
+ return m_text_low + ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
+ }
+
+ /* Return the relocated high text address of this partial_symtab. */
+ CORE_ADDR text_high (struct objfile *objfile) const
+ {
+ return m_text_high + ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
+ }
+
/* Set the low text address of this partial_symtab. */
void set_text_low (CORE_ADDR addr)
{
@@ -262,6 +276,7 @@ struct partial_symtab
extern void add_psymbol_to_list (const char *, int,
int, domain_enum,
enum address_class,
+ short /* section */,
std::vector<partial_symbol *> *,
CORE_ADDR,
enum language, struct objfile *);