gdb: Add aliases for read_core_file_mappings callbacks
[binutils-gdb.git] / gdb / exec.c
index b737bcf6e0f3c25462233b39cf50be0d24e4b5aa..1be51474b4adc590a2246554a3745e24c8f5f70b 100644 (file)
@@ -201,7 +201,7 @@ try_open_exec_file (const char *exec_file_host, struct inferior *inf,
        }
       catch (const gdb_exception_error &err)
        {
-         if (!exception_print_same (prev_err, err))
+         if (prev_err != err)
            warning ("%s", err.what ());
        }
     }
@@ -453,9 +453,8 @@ exec_file_attach (const char *filename, int from_tty)
 
       if (!current_program_space->exec_bfd ())
        {
-         error (_("\"%ps\": could not open as an executable file: %s."),
-                styled_string (file_name_style.style (), scratch_pathname),
-                bfd_errmsg (bfd_get_error ()));
+         error (_("\"%s\": could not open as an executable file: %s."),
+                scratch_pathname, bfd_errmsg (bfd_get_error ()));
        }
 
       /* gdb_realpath_keepfile resolves symlinks on the local
@@ -475,8 +474,7 @@ exec_file_attach (const char *filename, int from_tty)
          /* Make sure to close exec_bfd, or else "run" might try to use
             it.  */
          current_program_space->exec_close ();
-         error (_("\"%ps\": not in executable format: %s"),
-                styled_string (file_name_style.style (), scratch_pathname),
+         error (_("\"%s\": not in executable format: %s"), scratch_pathname,
                 gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
        }
 
@@ -636,8 +634,7 @@ program_space::add_target_sections (struct objfile *objfile)
       if (bfd_section_size (osect->the_bfd_section) == 0)
        continue;
 
-      m_target_sections.emplace_back (obj_section_addr (osect),
-                                     obj_section_endaddr (osect),
+      m_target_sections.emplace_back (osect->addr (), osect->endaddr (),
                                      osect->the_bfd_section, (void *) objfile);
     }
 }
@@ -679,10 +676,10 @@ program_space::remove_target_sections (void *owner)
 /* See exec.h.  */
 
 void
-exec_on_vfork ()
+exec_on_vfork (inferior *vfork_child)
 {
-  if (!current_program_space->target_sections ().empty ())
-    current_inferior ()->push_target (&exec_ops);
+  if (!vfork_child->pspace->target_sections ().empty ())
+    vfork_child->push_target (&exec_ops);
 }
 
 \f
@@ -775,7 +772,7 @@ section_table_read_available_memory (gdb_byte *readbuf, ULONGEST offset,
                                     ULONGEST len, ULONGEST *xfered_len)
 {
   const target_section_table *table
-    = target_get_section_table (current_top_target ());
+    = target_get_section_table (current_inferior ()->top_target ());
   std::vector<mem_range> available_memory
     = section_table_available_memory (offset, len, *table);