Replace xmalloc/xfree with vector in jit.c
[deliverable/binutils-gdb.git] / gdb / symfile-mem.c
index 118f28987a311ffabcc067c7da8e927bde220706..82fb17ed1654f7688fd75de0706b9ef38af3065e 100644 (file)
@@ -101,11 +101,9 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr,
   /* Manage the new reference for the duration of this function.  */
   gdb_bfd_ref_ptr nbfd_holder = gdb_bfd_ref_ptr::new_reference (nbfd);
 
-  xfree (bfd_get_filename (nbfd));
   if (name == NULL)
-    nbfd->filename = xstrdup ("shared object read from target memory");
-  else
-    nbfd->filename = name;
+    name = xstrdup ("shared object read from target memory");
+  bfd_set_filename (nbfd, name);
 
   if (!bfd_check_format (nbfd, bfd_object))
     error (_("Got object file from memory but can't read symbols: %s."),
@@ -113,9 +111,9 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr,
 
   section_addr_info sai;
   for (sec = nbfd->sections; sec != NULL; sec = sec->next)
-    if ((bfd_get_section_flags (nbfd, sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
-      sai.emplace_back (bfd_get_section_vma (nbfd, sec) + loadbase,
-                       bfd_get_section_name (nbfd, sec),
+    if ((bfd_section_flags (sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
+      sai.emplace_back (bfd_section_vma (sec) + loadbase,
+                       bfd_section_name (sec),
                        sec->index);
 
   if (from_tty)
@@ -198,7 +196,7 @@ add_vsyscall_page (struct target_ops *target, int from_tty)
                                       name,
                                       0 /* from_tty */);
        }
-      catch (const gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const gdb_exception &ex)
        {
          exception_print (gdb_stderr, ex);
        }
This page took 0.024483 seconds and 4 git commands to generate.