aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-03 16:36:19 -0600
committerTom Tromey <tom@tromey.com>2018-07-26 09:18:30 -0600
commit4ae976d1df96aee0ecd97ea1235efc4490562932 (patch)
tree06fef646b60339d2b42b63109505252742031125 /gdb/dwarf2read.c
parent02e9e7f7e2bed3b82cb6541f566caf07256b9b2f (diff)
downloadgdb-4ae976d1df96aee0ecd97ea1235efc4490562932.zip
gdb-4ae976d1df96aee0ecd97ea1235efc4490562932.tar.gz
gdb-4ae976d1df96aee0ecd97ea1235efc4490562932.tar.bz2
Introduce accessors for psymtab high and low fields
This introduces accessors for the partial symbol table textlow and texthigh fields. This lets us later arrange to relocate these values at their point of use. I did this conversion by renaming the fields. I didn't rename the fields back afterward, thinking that on the off chance that someone has a patch touching this area, then a merge would helpfully break their compile. I looked at making the fields private, but this interferes with the memset in allocate_psymtab, and I didn't want to chase this down. This conversion can be done later if need be. gdb/ChangeLog 2018-07-26 Tom Tromey <tom@tromey.com> * dbxread.c (read_dbx_symtab, end_psymtab, read_ofile_symtab): Update. * dwarf2read.c (dwarf2_create_include_psymtab): Don't initialize textlow and texthigh fields. (process_psymtab_comp_unit_reader, dwarf2_build_include_psymtabs): Update. * mdebugread.c (parse_lines, parse_partial_symbols) (psymtab_to_symtab_1): Update. * psympriv.h (struct partial_symtab) <m_text_low, m_text_high>: Rename fields. Update comment. Now private. <text_low, text_high, set_text_low, set_text_high>: New methods. * psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymtab) (find_pc_sect_psymbol, relocate_psymtabs, dump_psymtab) (start_psymtab_common, maintenance_info_psymtabs) (maintenance_check_psymtabs): Update. * xcoffread.c (xcoff_end_psymtab): Don't initialize textlow and texthigh fields. (scan_xcoff_symtab): Update.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index d16700f..3b0cbd9 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6507,9 +6507,6 @@ dwarf2_create_include_psymtab (const char *name, struct partial_symtab *pst,
subpst->dirname = pst->dirname;
}
- subpst->textlow = 0;
- subpst->texthigh = 0;
-
subpst->dependencies
= XOBNEW (&objfile->objfile_obstack, struct partial_symtab *);
subpst->dependencies[0] = pst;
@@ -6548,7 +6545,8 @@ dwarf2_build_include_psymtabs (struct dwarf2_cu *cu,
return; /* No linetable, so no includes. */
/* NOTE: pst->dirname is DW_AT_comp_dir (if present). */
- dwarf_decode_lines (lh.get (), pst->dirname, cu, pst, pst->textlow, 1);
+ dwarf_decode_lines (lh.get (), pst->dirname, cu, pst,
+ pst->text_low (), 1);
}
static hashval_t
@@ -7970,8 +7968,10 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
best_highpc = highpc;
}
}
- pst->textlow = gdbarch_adjust_dwarf2_addr (gdbarch, best_lowpc + baseaddr);
- pst->texthigh = gdbarch_adjust_dwarf2_addr (gdbarch, best_highpc + baseaddr);
+ pst->set_text_low (gdbarch_adjust_dwarf2_addr (gdbarch,
+ best_lowpc + baseaddr));
+ pst->set_text_high (gdbarch_adjust_dwarf2_addr (gdbarch,
+ best_highpc + baseaddr));
end_psymtab_common (objfile, pst);
@@ -8008,8 +8008,8 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
", %d global, %d static syms\n",
per_cu->is_debug_types ? "type" : "comp",
sect_offset_str (per_cu->sect_off),
- paddress (gdbarch, pst->textlow),
- paddress (gdbarch, pst->texthigh),
+ paddress (gdbarch, pst->text_low ()),
+ paddress (gdbarch, pst->text_high ()),
pst->n_global_syms, pst->n_static_syms);
}
}