Small fix to gdb.Value constructor doc
[deliverable/binutils-gdb.git] / gdb / solib-dsbt.c
index 9868606249bdb1559868c79c9dffe2bb4b2b4988..20310144f32b2e93d6864e89ff0dc5e1f294ca5d 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle TIC6X (DSBT) shared libraries for GDB, the GNU Debugger.
-   Copyright (C) 2010-2018 Free Software Foundation, Inc.
+   Copyright (C) 2010-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -293,7 +293,7 @@ dsbt_get_initial_loadmaps (void)
 {
   struct dsbt_info *info = get_dsbt_info ();
   gdb::optional<gdb::byte_vector> buf
-    = target_read_alloc (target_stack, TARGET_OBJECT_FDPIC, "exec");
+    = target_read_alloc (current_top_target (), TARGET_OBJECT_FDPIC, "exec");
 
   if (!buf || buf->empty ())
     {
@@ -304,7 +304,7 @@ dsbt_get_initial_loadmaps (void)
   if (solib_dsbt_debug)
     dsbt_print_loadmap (info->exec_loadmap);
 
-  buf = target_read_alloc (target_stack, TARGET_OBJECT_FDPIC, "exec");
+  buf = target_read_alloc (current_top_target (), TARGET_OBJECT_FDPIC, "exec");
   if (!buf || buf->empty ())
     {
       info->interp_loadmap = NULL;
@@ -650,7 +650,7 @@ dsbt_current_sos (void)
   /* Locate the address of the first link map struct.  */
   lm_addr = lm_base ();
 
-  /* We have at least one link map entry.  Fetch the the lot of them,
+  /* We have at least one link map entry.  Fetch the lot of them,
      building the solist chain.  */
   while (lm_addr)
     {
@@ -918,8 +918,6 @@ static void
 dsbt_relocate_main_executable (void)
 {
   struct int_elf32_dsbt_loadmap *ldm;
-  struct cleanup *old_chain;
-  struct section_offsets *new_offsets;
   int changed;
   struct obj_section *osect;
   struct dsbt_info *info = get_dsbt_info ();
@@ -931,9 +929,8 @@ dsbt_relocate_main_executable (void)
   info->main_executable_lm_info = new lm_info_dsbt;
   info->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)
@@ -967,9 +964,7 @@ dsbt_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.  */
This page took 0.028345 seconds and 4 git commands to generate.