AArch64: Close sequences at the end of sections
[deliverable/binutils-gdb.git] / gdb / solib.c
index f9a31bca196757f83a6503e1fa3ad20cf008a7d2..e1d237e5a4a63cf05811560e40d2d5133a393c4d 100644 (file)
@@ -38,7 +38,7 @@
 #include "filenames.h"         /* for DOSish file names */
 #include "exec.h"
 #include "solist.h"
-#include "observer.h"
+#include "observable.h"
 #include "readline/readline.h"
 #include "remote.h"
 #include "solib.h"
@@ -735,7 +735,7 @@ update_solib_list (int from_tty)
 
   /* We can reach here due to changing solib-search-path or the
      sysroot, before having any inferior.  */
-  if (target_has_execution && !ptid_equal (inferior_ptid, null_ptid))
+  if (target_has_execution && inferior_ptid != null_ptid)
     {
       struct inferior *inf = current_inferior ();
 
@@ -824,7 +824,7 @@ update_solib_list (int from_tty)
        {
          /* Notify any observer that the shared object has been
             unloaded before we remove it from GDB's tables.  */
-         observer_notify_solib_unloaded (gdb);
+         gdb::observers::solib_unloaded.notify (gdb);
 
          current_program_space->deleted_solibs.push_back (gdb->so_name);
 
@@ -862,7 +862,7 @@ update_solib_list (int from_tty)
        {
 
          i->pspace = current_program_space;
-         VEC_safe_push (so_list_ptr, current_program_space->added_solibs, i);
+         current_program_space->added_solibs.push_back (i);
 
          TRY
            {
@@ -885,7 +885,7 @@ update_solib_list (int from_tty)
 
          /* Notify any observer that the shared object has been
             loaded now that we've added it to GDB's tables.  */
-         observer_notify_solib_loaded (i);
+         gdb::observers::solib_loaded.notify (i);
        }
 
       /* If a library was not found, issue an appropriate warning
@@ -1093,7 +1093,7 @@ info_sharedlibrary_command (const char *pattern, int from_tty)
            uiout->field_skip ("to");
          }
 
-       if (! interp_ui_out (top_level_interpreter ())->is_mi_like_p ()
+       if (! top_level_interpreter ()->interp_ui_out ()->is_mi_like_p ()
            && so->symbols_loaded
            && !objfile_has_symbols (so->objfile))
          {
@@ -1193,7 +1193,7 @@ clear_solib (void)
       struct so_list *so = so_list_head;
 
       so_list_head = so->next;
-      observer_notify_solib_unloaded (so);
+      gdb::observers::solib_unloaded.notify (so);
       remove_target_sections (so);
       free_so (so);
     }
@@ -1474,8 +1474,8 @@ gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
     {
       unsigned int i;
 
-      asymbol **symbol_table = (asymbol **) xmalloc (storage_needed);
-      struct cleanup *back_to = make_cleanup (xfree, symbol_table);
+      gdb::def_vector<asymbol *> storage (storage_needed / sizeof (asymbol *));
+      asymbol **symbol_table = storage.data ();
       unsigned int number_of_symbols =
        bfd_canonicalize_symtab (abfd, symbol_table);
 
@@ -1510,7 +1510,6 @@ gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
              break;
            }
        }
-      do_cleanups (back_to);
     }
 
   return symaddr;
@@ -1533,8 +1532,8 @@ bfd_lookup_symbol_from_dyn_symtab (bfd *abfd,
   if (storage_needed > 0)
     {
       unsigned int i;
-      asymbol **symbol_table = (asymbol **) xmalloc (storage_needed);
-      struct cleanup *back_to = make_cleanup (xfree, symbol_table);
+      gdb::def_vector<asymbol *> storage (storage_needed / sizeof (asymbol *));
+      asymbol **symbol_table = storage.data ();
       unsigned int number_of_symbols =
        bfd_canonicalize_dynamic_symtab (abfd, symbol_table);
 
@@ -1549,7 +1548,6 @@ bfd_lookup_symbol_from_dyn_symtab (bfd *abfd,
              break;
            }
        }
-      do_cleanups (back_to);
     }
   return symaddr;
 }
@@ -1597,7 +1595,7 @@ _initialize_solib (void)
 {
   solib_data = gdbarch_data_register_pre_init (solib_init);
 
-  observer_attach_free_objfile (remove_user_added_objfile);
+  gdb::observers::free_objfile.attach (remove_user_added_objfile);
 
   add_com ("sharedlibrary", class_files, sharedlibrary_command,
           _("Load shared object library symbols for files matching REGEXP."));
This page took 0.034355 seconds and 4 git commands to generate.