X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fcorefile.c;h=4ce1bb78f2829f869726e9171af5818bf15e9c9e;hb=7b958a48e1322880f23cdb0a1c35643dd27d3ddb;hp=5a735264efb8b39b385be471fbd6b0440bef8c95;hpb=76727919ceb590f03ff0f6db08b7ceab5b7aeaff;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/corefile.c b/gdb/corefile.c index 5a735264ef..4ce1bb78f2 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -1,6 +1,6 @@ /* Core dump and executable file functions above target vector, for GDB. - Copyright (C) 1986-2018 Free Software Foundation, Inc. + Copyright (C) 1986-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -32,6 +32,7 @@ #include "completer.h" #include "observable.h" #include "cli/cli-utils.h" +#include "gdbarch.h" /* You can have any number of hooks for `exec_file_command' command to call. If there's only one hook, it is set in exec_file_display @@ -49,29 +50,6 @@ static hook_type *exec_file_extra_hooks; /* Array of additional hooks. */ static int exec_file_hook_count = 0; /* Size of array. */ -/* Binary file diddling handle for the core file. */ - -bfd *core_bfd = NULL; - -/* corelow.c target. It is never NULL after GDB initialization. */ - -struct target_ops *core_target; - - -/* Backward compatability with old way of specifying core files. */ - -void -core_file_command (const char *filename, int from_tty) -{ - dont_repeat (); /* Either way, seems bogus. */ - - gdb_assert (core_target != NULL); - - if (!filename) - (core_target->to_detach) (core_target, current_inferior (), from_tty); - else - (core_target->to_open) (filename, from_tty); -} /* If there are two or more functions that wish to hook into @@ -161,9 +139,9 @@ validate_files (void) } } -/* See common/common-inferior.h. */ +/* See gdbsupport/common-inferior.h. */ -char * +const char * get_exec_file (int err) { if (exec_filename) @@ -173,7 +151,6 @@ get_exec_file (int err) error (_("No executable file specified.\n\ Use the \"file\" or \"exec-file\" command.")); - return NULL; } @@ -237,8 +214,7 @@ read_memory_object (enum target_object object, CORE_ADDR memaddr, enum target_xfer_status status; ULONGEST xfered_len; - status = target_xfer_partial (current_target.beneath, - object, NULL, + status = target_xfer_partial (current_top_target (), object, NULL, myaddr + xfered, NULL, memaddr + xfered, len - xfered, &xfered_len); @@ -439,7 +415,7 @@ write_memory_signed_integer (CORE_ADDR addr, int len, /* The current default bfd target. Points to storage allocated for gnutarget_string. */ -char *gnutarget; +const char *gnutarget; /* Same thing, except it is "auto" not NULL for the default case. */ static char *gnutarget_string; @@ -502,13 +478,15 @@ set_gnutarget (const char *newtarget) set_gnutarget_command (NULL, 0, NULL); } +void _initialize_core (); void -_initialize_core (void) +_initialize_core () { struct cmd_list_element *c; c = add_cmd ("core-file", class_files, core_file_command, _("\ Use FILE as core dump for examining memory and registers.\n\ +Usage: core-file FILE\n\ No arg means have no core file. This command has been superseded by the\n\ `target core' and `detach' commands."), &cmdlist); set_cmd_completer (c, filename_completer);