aboutsummaryrefslogtreecommitdiff
path: root/gdb/corefile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/corefile.c')
-rw-r--r--gdb/corefile.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 9f27f14..666ff55 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -66,13 +66,14 @@ reopen_exec_file (void)
void
validate_files (void)
{
- if (current_program_space->exec_bfd () && current_program_space->core_bfd ())
+ bfd *ebfd = current_program_space->exec_bfd ();
+ bfd *cbfd = get_inferior_core_bfd (current_inferior ());
+
+ if (ebfd != nullptr && cbfd != nullptr)
{
- if (!core_file_matches_executable_p (current_program_space->core_bfd (),
- current_program_space->exec_bfd ()))
+ if (!core_file_matches_executable_p (cbfd, ebfd))
warning (_("core file may not match specified executable file."));
- else if (gdb_bfd_get_mtime (current_program_space->exec_bfd ())
- > gdb_bfd_get_mtime (current_program_space->core_bfd ()))
+ else if (gdb_bfd_get_mtime (ebfd) > gdb_bfd_get_mtime (cbfd))
warning (_("exec file is newer than core file."));
}
}
@@ -391,9 +392,7 @@ set_gnutarget (const char *newtarget)
set_gnutarget_command (NULL, 0, NULL);
}
-void _initialize_core ();
-void
-_initialize_core ()
+INIT_GDB_FILE (core)
{
cmd_list_element *core_file_cmd
= add_cmd ("core-file", class_files, core_file_command, _("\