summaryrefslogtreecommitdiff
path: root/gdb/symmisc.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-08-02 09:55:32 -0600
committerTom Tromey <tom@tromey.com>2022-08-03 13:26:58 -0600
commit98badbfdc222d1d7f346046f23a64522b88d22a0 (patch)
treea57a95b75f64a0e318e0b1bd31dd6b246e4797d8 /gdb/symmisc.c
parent4d44946794e68cf79cfba467fa414a958dba2185 (diff)
Use gdb_bfd_ref_ptr in objfile
This changes struct objfile to use a gdb_bfd_ref_ptr. In addition to removing some manual memory management, this fixes a use-after-free that was introduced by the registry rewrite series. The issue there was that, in some cases, registry shutdown could refer to memory that had already been freed. This help fix the bug by delaying the destruction of the BFD reference (and thus the per-bfd object) until after the registry has been shut down.
Diffstat (limited to 'gdb/symmisc.c')
-rw-r--r--gdb/symmisc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 68b76bf3b8..8508c06b34 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -116,7 +116,7 @@ dump_objfile (struct objfile *objfile)
gdb_printf ("\nObject file %s: ", objfile_name (objfile));
gdb_printf ("Objfile at %s, bfd at %s, %d minsyms\n\n",
host_address_to_string (objfile),
- host_address_to_string (objfile->obfd),
+ host_address_to_string (objfile->obfd.get ()),
objfile->per_bfd->minimal_symbol_count);
objfile->dump ();