aboutsummaryrefslogtreecommitdiff
path: root/gdb/machoread.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/machoread.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/machoread.c')
-rw-r--r--gdb/machoread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 90f25b3..8c4b08f 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -860,7 +860,7 @@ macho_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
if (dwarf2_has_info (objfile, NULL))
{
/* DWARF 2 sections */
- dwarf2_build_psymtabs (objfile);
+ dwarf2_initialize_objfile (objfile);
}
/* Then the oso. */