Convert observers to C++
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index 70e369b8b4fa376ae7236f4863d3b4816c604c0c..98e81c48c467cac139b1a635a0414f12033e115a 100644 (file)
 #include "addrmap.h"
 #include "arch-utils.h"
 #include "exec.h"
-#include "observer.h"
+#include "observable.h"
 #include "complaints.h"
 #include "psymtab.h"
 #include "solist.h"
 #include "gdb_bfd.h"
 #include "btrace.h"
+#include "common/pathstuff.h"
 
 #include <vector>
 
@@ -616,7 +617,7 @@ free_objfile_separate_debug (struct objfile *objfile)
 objfile::~objfile ()
 {
   /* First notify observers that this objfile is about to be freed.  */
-  observer_notify_free_objfile (this);
+  gdb::observers::free_objfile.notify (this);
 
   /* Free all separate debug objfiles.  */
   free_objfile_separate_debug (this);
@@ -905,16 +906,13 @@ objfile_relocate (struct objfile *objfile,
        debug_objfile;
        debug_objfile = objfile_separate_debug_iterate (objfile, debug_objfile))
     {
-      struct section_addr_info *objfile_addrs;
-      struct cleanup *my_cleanups;
-
-      objfile_addrs = build_section_addr_info_from_objfile (objfile);
-      my_cleanups = make_cleanup (xfree, objfile_addrs);
+      section_addr_info objfile_addrs
+       = build_section_addr_info_from_objfile (objfile);
 
       /* Here OBJFILE_ADDRS contain the correct absolute addresses, the
         relative ones must be already created according to debug_objfile.  */
 
-      addr_info_make_relative (objfile_addrs, debug_objfile->obfd);
+      addr_info_make_relative (&objfile_addrs, debug_objfile->obfd);
 
       gdb_assert (debug_objfile->num_sections
                  == gdb_bfd_count_sections (debug_objfile->obfd));
@@ -925,8 +923,6 @@ objfile_relocate (struct objfile *objfile,
                                             objfile_addrs);
 
       changed |= objfile_relocate1 (debug_objfile, new_debug_offsets.data ());
-
-      do_cleanups (my_cleanups);
     }
 
   /* Relocate breakpoints as necessary, after things are relocated.  */
This page took 0.031578 seconds and 4 git commands to generate.