aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 083ec91..9f6d34f 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -24997,13 +24997,13 @@ free_one_cached_comp_unit (struct dwarf2_per_cu_data *target_per_cu)
}
}
-/* Release all extra memory associated with OBJFILE. */
+/* Cleanup function for the dwarf2_per_objfile data. */
-void
-dwarf2_free_objfile (struct objfile *objfile)
+static void
+dwarf2_free_objfile (struct objfile *objfile, void *datum)
{
struct dwarf2_per_objfile *dwarf2_per_objfile
- = get_dwarf2_per_objfile (objfile);
+ = static_cast<struct dwarf2_per_objfile *> (datum);
delete dwarf2_per_objfile;
}
@@ -25325,8 +25325,8 @@ show_check_physname (struct ui_file *file, int from_tty,
void
_initialize_dwarf2_read (void)
{
-
- dwarf2_objfile_data_key = register_objfile_data ();
+ dwarf2_objfile_data_key
+ = register_objfile_data_with_cleanup (nullptr, dwarf2_free_objfile);
add_prefix_cmd ("dwarf", class_maintenance, set_dwarf_cmd, _("\
Set DWARF specific variables.\n\