]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/solib-frv.c
[binutils, ARM, 4/16] BF insns infrastructure with array of relocs in struct arm_it
[thirdparty/binutils-gdb.git] / gdb / solib-frv.c
index e772da61156575552a5ed31a2118924d8e69cd87..fdd4b3453057023755d155f11fa8f084dc36bf93 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle FR-V (FDPIC) shared libraries for GDB, the GNU Debugger.
-   Copyright (C) 2004-2018 Free Software Foundation, Inc.
+   Copyright (C) 2004-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -561,14 +561,13 @@ enable_break2 (void)
          mechanism to find the dynamic linker's base address.  */
 
       gdb_bfd_ref_ptr tmp_bfd;
-      TRY
+      try
         {
           tmp_bfd = solib_bfd_open (buf);
         }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception &ex)
        {
        }
-      END_CATCH
 
       if (tmp_bfd == NULL)
        {
@@ -769,8 +768,6 @@ frv_relocate_main_executable (void)
   int status;
   CORE_ADDR exec_addr, interp_addr;
   struct int_elf32_fdpic_loadmap *ldm;
-  struct cleanup *old_chain;
-  struct section_offsets *new_offsets;
   int changed;
   struct obj_section *osect;
 
@@ -792,9 +789,8 @@ frv_relocate_main_executable (void)
   main_executable_lm_info = new lm_info_frv;
   main_executable_lm_info->map = ldm;
 
-  new_offsets = XCNEWVEC (struct section_offsets,
-                         symfile_objfile->num_sections);
-  old_chain = make_cleanup (xfree, new_offsets);
+  gdb::unique_xmalloc_ptr<struct section_offsets> new_offsets
+    (XCNEWVEC (struct section_offsets, symfile_objfile->num_sections));
   changed = 0;
 
   ALL_OBJFILE_OSECTIONS (symfile_objfile, osect)
@@ -828,9 +824,7 @@ frv_relocate_main_executable (void)
     }
 
   if (changed)
-    objfile_relocate (symfile_objfile, new_offsets);
-
-  do_cleanups (old_chain);
+    objfile_relocate (symfile_objfile, new_offsets.get ());
 
   /* Now that symfile_objfile has been relocated, we can compute the
      GOT value and stash it away.  */