gdb/tui: Place window titles in the center of the border
[deliverable/binutils-gdb.git] / gdb / symfile-mem.c
index 51a75541e52d22514c512b0f652a8e4d4a44c436..a62d0d0c8f471ad8433f4138501a8f1d75f8fa5c 100644 (file)
@@ -1,6 +1,6 @@
 /* Reading symbol files from memory.
 
-   Copyright (C) 1986-2019 Free Software Foundation, Inc.
+   Copyright (C) 1986-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -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)
@@ -205,8 +203,9 @@ add_vsyscall_page (struct target_ops *target, int from_tty)
     }
 }
 
+void _initialize_symfile_mem ();
 void
-_initialize_symfile_mem (void)
+_initialize_symfile_mem ()
 {
   add_cmd ("add-symbol-file-from-memory", class_files,
            add_symbol_file_from_memory_command,
This page took 0.02461 seconds and 4 git commands to generate.