Add IA64_MAX_FP_REGISTER_SIZE
[deliverable/binutils-gdb.git] / gdb / exec.c
index c8ec25a2953ba555c8b26beee0efbd6f3381de9d..05ecb1bd827e2a1379c8f35d5a2333e7dda49319 100644 (file)
@@ -113,17 +113,14 @@ static void
 exec_close_1 (struct target_ops *self)
 {
   struct program_space *ss;
-  struct cleanup *old_chain;
+  scoped_restore_current_program_space restore_pspace;
 
-  old_chain = save_current_program_space ();
   ALL_PSPACES (ss)
-  {
-    set_current_program_space (ss);
-    clear_section_table (current_target_sections);
-    exec_close ();
-  }
-
-  do_cleanups (old_chain);
+    {
+      set_current_program_space (ss);
+      clear_section_table (current_target_sections);
+      exec_close ();
+    }
 }
 
 void
@@ -258,7 +255,9 @@ exec_file_attach (const char *filename, int from_tty)
      this at the end of the function; but acquiring it now lets the
      BFD cache return it if this call refers to the same file.  */
   gdb_bfd_ref (exec_bfd);
-  cleanups = make_cleanup_bfd_unref (exec_bfd);
+  gdb_bfd_ref_ptr exec_bfd_holder (exec_bfd);
+
+  cleanups = make_cleanup (null_cleanup, NULL);
 
   /* Remove any previous exec file.  */
   exec_close ();
@@ -333,11 +332,13 @@ exec_file_attach (const char *filename, int from_tty)
          make_cleanup (xfree, canonical_pathname);
        }
 
+      gdb_bfd_ref_ptr temp;
       if (write_files && !load_via_target)
-       exec_bfd = gdb_bfd_fopen (canonical_pathname, gnutarget,
-                                 FOPEN_RUB, scratch_chan);
+       temp = gdb_bfd_fopen (canonical_pathname, gnutarget,
+                             FOPEN_RUB, scratch_chan);
       else
-       exec_bfd = gdb_bfd_open (canonical_pathname, gnutarget, scratch_chan);
+       temp = gdb_bfd_open (canonical_pathname, gnutarget, scratch_chan);
+      exec_bfd = temp.release ();
 
       if (!exec_bfd)
        {
This page took 0.025973 seconds and 4 git commands to generate.