aboutsummaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-04-19 11:32:04 -0600
committerTom Tromey <tromey@adacore.com>2022-04-21 12:18:25 -0600
commit31de881f8f9a03499002d28ff42286b79c24a97d (patch)
tree5b53fb49b9872daf60c36d0fe78f6c9ad0553fe5 /gdb/coffread.c
parent5f21c7aae2040f3463d1ff56a4b0bcdbba34832d (diff)
downloadgdb-31de881f8f9a03499002d28ff42286b79c24a97d.zip
gdb-31de881f8f9a03499002d28ff42286b79c24a97d.tar.gz
gdb-31de881f8f9a03499002d28ff42286b79c24a97d.tar.bz2
Always use dwarf2_initialize_objfile
Internally we noticed that some tests would fail like so on Windows: warning: Section .debug_aranges in [...] has duplicate debug_info_offset 0x0, ignoring .debug_aranges. Debugging showed that, in fact, a second CU was being created at this offset. We tracked this down to the fact that, while the ELF reader is careful to re-use the per-BFD data, other readers are not, and could re-read the DWARF data multiple times. However, since the change to allow an objfile to have multiple "quick symbol" implementations, there's no reason for this approach -- it's safe and easy for all symbol readers to reuse the per-BFD data when reading DWARF. This patch implements this idea, simplifying dwarf2_build_psymtabs and making it private, and then switching to dwarf2_initialize_objfile as the sole way to start the DWARF reader. Note that, while I think the call to dwarf2_build_frame_info in machoread.c is also obsolete, I haven't attempted to remove it here.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index f5ef128..da871d5 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -702,11 +702,9 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
if (dwarf2_has_info (objfile, NULL))
{
/* DWARF2 sections. */
- dwarf2_build_psymtabs (objfile);
+ dwarf2_initialize_objfile (objfile);
}
- dwarf2_build_frame_info (objfile);
-
/* Try to add separate debug file if no symbols table found. */
if (!objfile->has_partial_symbols ())
{