* target.h (target_ops): Removed to_core_file_to_sym_file vector

function.
* corelow.c (core_ops): Updated for above change.
* gnu-nat.c (core_ops): Likewise.
* inftarg.c (child_ops): Likewise.
* monitor.c (monitor_ops): Likewise.
* ppc-bdm.c (bdm_ppc_ops): Likewise.
* remote-adapt.c (adapt_ops): Likewise.
* remote-bug.c (bug_ops): Likewise.
* remote-e7000.c (e7000_ops): Likewise.
* remote-eb.c (eb_ops): Likewise.
* remote-es.c (es1800_ops, es1800_child_ops): Likewise.
* remote-mm.c (mm_ops): Likewise.
* remote-nindy.c (nindy_ops): Likewise.
* remote-nrom.c (nrom_ops): Likewise.
* remote-os9k.c (rombug_ops): Likewise.
* remote-rdp.c (remote_rdp_ops): Likewise.
* remote-sim.c (gdbsim_ops): Likewise.
* remote-st.c (st2000_ops): Likewise.
* v850ice.c (v850ice_ops): Likewise.
* target.c (cleanup_target): Likewise
(update_current_target): Likewise.
(setup_target_debug): Likewise
(debug_to_core_file_to_sym_file): Removed.

* corefile.c (core_file_command) [HPUXHPPA]: Removed code that
sets symbol file from information obtained from the core file.
* corelow.c (core_file_to_sym_file): Removed.
This commit is contained in:
J.T. Conklin 2001-04-14 19:23:02 +00:00
parent 767e4b0d59
commit 46c6cdcf5e
24 changed files with 37 additions and 132 deletions

View File

@ -1,3 +1,34 @@
2001-04-14 J.T. Conklin <jtc@redback.com>
* target.h (target_ops): Removed to_core_file_to_sym_file vector
function.
* corelow.c (core_ops): Updated for above change.
* gnu-nat.c (core_ops): Likewise.
* inftarg.c (child_ops): Likewise.
* monitor.c (monitor_ops): Likewise.
* ppc-bdm.c (bdm_ppc_ops): Likewise.
* remote-adapt.c (adapt_ops): Likewise.
* remote-bug.c (bug_ops): Likewise.
* remote-e7000.c (e7000_ops): Likewise.
* remote-eb.c (eb_ops): Likewise.
* remote-es.c (es1800_ops, es1800_child_ops): Likewise.
* remote-mm.c (mm_ops): Likewise.
* remote-nindy.c (nindy_ops): Likewise.
* remote-nrom.c (nrom_ops): Likewise.
* remote-os9k.c (rombug_ops): Likewise.
* remote-rdp.c (remote_rdp_ops): Likewise.
* remote-sim.c (gdbsim_ops): Likewise.
* remote-st.c (st2000_ops): Likewise.
* v850ice.c (v850ice_ops): Likewise.
* target.c (cleanup_target): Likewise
(update_current_target): Likewise.
(setup_target_debug): Likewise
(debug_to_core_file_to_sym_file): Removed.
* corefile.c (core_file_command) [HPUXHPPA]: Removed code that
sets symbol file from information obtained from the core file.
* corelow.c (core_file_to_sym_file): Removed.
2001-04-13 Fernando Nasser <fnasser@redhat.com>
From Adam Mirowski <Adam.Mirowski@Sun.COM>

View File

@ -69,35 +69,13 @@ core_file_command (char *filename, int from_tty)
dont_repeat (); /* Either way, seems bogus. */
t = find_core_target ();
if (t != NULL)
if (!filename)
(t->to_detach) (filename, from_tty);
else
{
/* Yes, we were given the path of a core file. Do we already
have a symbol file? If not, can we determine it from the
core file? If we can, do so.
*/
#ifdef HPUXHPPA
if (symfile_objfile == NULL)
{
char *symfile;
symfile = t->to_core_file_to_sym_file (filename);
if (symfile)
{
char *symfile_copy = xstrdup (symfile);
make_cleanup (xfree, symfile_copy);
symbol_file_add_main (symfile_copy, from_tty);
}
else
warning ("Unknown symbols for '%s'; use the 'symbol-file' command.", filename);
}
#endif
(t->to_open) (filename, from_tty);
}
else
if (t == NULL)
error ("GDB can't read core files on this machine.");
if (!filename)
(t->to_detach) (filename, from_tty);
else
(t->to_open) (filename, from_tty);
}

View File

@ -77,8 +77,6 @@ static void add_to_thread_list (bfd *, asection *, PTR);
static int ignore (CORE_ADDR, char *);
static char *core_file_to_sym_file (char *);
static int core_file_thread_alive (int tid);
static void init_core_ops (void);
@ -464,68 +462,6 @@ get_core_registers (int regno)
registers_fetched ();
}
static char *
core_file_to_sym_file (char *core)
{
CONST char *failing_command;
char *p;
char *temp;
bfd *temp_bfd;
int scratch_chan;
if (!core)
error ("No core file specified.");
core = tilde_expand (core);
if (core[0] != '/')
{
temp = concat (current_directory, "/", core, NULL);
core = temp;
}
scratch_chan = open (core, write_files ? O_RDWR : O_RDONLY, 0);
if (scratch_chan < 0)
perror_with_name (core);
temp_bfd = bfd_fdopenr (core, gnutarget, scratch_chan);
if (temp_bfd == NULL)
perror_with_name (core);
if (!bfd_check_format (temp_bfd, bfd_core))
{
/* Do it after the err msg */
/* FIXME: should be checking for errors from bfd_close (for one thing,
on error it does not free all the storage associated with the
bfd). */
make_cleanup_bfd_close (temp_bfd);
error ("\"%s\" is not a core dump: %s",
core, bfd_errmsg (bfd_get_error ()));
}
/* Find the data section */
if (build_section_table (temp_bfd, &core_ops.to_sections,
&core_ops.to_sections_end))
error ("\"%s\": Can't find sections: %s",
bfd_get_filename (temp_bfd), bfd_errmsg (bfd_get_error ()));
failing_command = bfd_core_file_failing_command (temp_bfd);
bfd_close (temp_bfd);
/* If we found a filename, remember that it is probably saved
relative to the executable that created it. If working directory
isn't there now, we may not be able to find the executable. Rather
than trying to be sauve about finding it, just check if the file
exists where we are now. If not, then punt and tell our client
we couldn't find the sym file.
*/
p = (char *) failing_command;
if ((p != NULL) && (access (p, F_OK) != 0))
p = NULL;
return p;
}
static void
core_files_info (struct target_ops *t)
{
@ -577,7 +513,6 @@ init_core_ops (void)
core_ops.to_create_inferior = find_default_create_inferior;
core_ops.to_clone_and_follow_inferior = find_default_clone_and_follow_inferior;
core_ops.to_thread_alive = core_file_thread_alive;
core_ops.to_core_file_to_sym_file = core_file_to_sym_file;
core_ops.to_stratum = core_stratum;
core_ops.to_has_memory = 1;
core_ops.to_has_stack = 1;

View File

@ -2561,7 +2561,6 @@ init_gnu_ops (void)
gnu_ops.to_pid_to_str = gnu_pid_to_str; /* to_pid_to_str */
gnu_ops.to_stop = gnu_stop; /* to_stop */
gnu_ops.to_pid_to_exec_file = gnu_pid_to_exec_file; /* to_pid_to_exec_file */
gnu_ops.to_core_file_to_sym_file = NULL;
gnu_ops.to_stratum = process_stratum; /* to_stratum */
gnu_ops.DONT_USE = 0; /* to_next */
gnu_ops.to_has_all_memory = 1; /* to_has_all_memory */

View File

@ -797,7 +797,6 @@ init_child_ops (void)
child_ops.to_enable_exception_callback = child_enable_exception_callback;
child_ops.to_get_current_exception_event = child_get_current_exception_event;
child_ops.to_pid_to_exec_file = child_pid_to_exec_file;
child_ops.to_core_file_to_sym_file = child_core_file_to_sym_file;
child_ops.to_stratum = process_stratum;
child_ops.to_has_all_memory = 1;
child_ops.to_has_memory = 1;

View File

@ -381,7 +381,6 @@ init_child_ops (void)
child_ops.to_thread_alive = 0;
child_ops.to_stop = child_stop;
child_ops.to_pid_to_exec_file = NULL; /* to_pid_to_exec_file */
child_ops.to_core_file_to_sym_file = NULL;
child_ops.to_stratum = process_stratum;
child_ops.DONT_USE = 0;
child_ops.to_has_all_memory = 1;

View File

@ -2309,7 +2309,6 @@ init_base_monitor_ops (void)
monitor_ops.to_stop = monitor_stop;
monitor_ops.to_rcmd = monitor_rcmd;
monitor_ops.to_pid_to_exec_file = NULL;
monitor_ops.to_core_file_to_sym_file = NULL;
monitor_ops.to_stratum = process_stratum;
monitor_ops.DONT_USE = 0;
monitor_ops.to_has_all_memory = 1;

View File

@ -364,7 +364,6 @@ a wiggler, specify wiggler and then the port it is connected to\n\
bdm_ppc_ops.to_thread_alive = ocd_thread_alive;
bdm_ppc_ops.to_stop = ocd_stop;
bdm_ppc_ops.to_pid_to_exec_file = NULL;
bdm_ppc_ops.to_core_file_to_sym_file = NULL;
bdm_ppc_ops.to_stratum = process_stratum;
bdm_ppc_ops.DONT_USE = NULL;
bdm_ppc_ops.to_has_all_memory = 1;

View File

@ -1502,7 +1502,6 @@ init_adapt_ops (void)
adapt_ops.to_thread_alive = 0;
adapt_ops.to_stop = 0; /* process_stratum; */
adapt_ops.to_pid_to_exec_file = NULL;
adapt_ops.to_core_file_to_sym_file = NULL;
adapt_ops.to_stratum = 0;
adapt_ops.DONT_USE = 0;
adapt_ops.to_has_all_memory = 1;

View File

@ -178,7 +178,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
array_ops.to_thread_alive = 0;
array_ops.to_stop = 0;
array_ops.to_pid_to_exec_file = NULL;
array_ops.to_core_file_to_sym_file = NULL;
array_ops.to_stratum = process_stratum;
array_ops.DONT_USE = 0;
array_ops.to_has_all_memory = 1;

View File

@ -946,7 +946,6 @@ init_bug_ops (void)
bug_ops.to_thread_alive = 0;
bug_ops.to_stop = 0;
bug_ops.to_pid_to_exec_file = NULL;
bug_ops.to_core_file_to_sym_file = NULL;
bug_ops.to_stratum = process_stratum;
bug_ops.DONT_USE = 0;
bug_ops.to_has_all_memory = 1;

View File

@ -2199,7 +2199,6 @@ target e7000 foobar";
e7000_ops.to_thread_alive = 0;
e7000_ops.to_stop = e7000_stop;
e7000_ops.to_pid_to_exec_file = NULL;
e7000_ops.to_core_file_to_sym_file = NULL;
e7000_ops.to_stratum = process_stratum;
e7000_ops.DONT_USE = 0;
e7000_ops.to_has_all_memory = 1;

View File

@ -1068,7 +1068,6 @@ target amd-eb /dev/ttya 9600 demo",
eb_ops.to_thread_alive = 0; /* thread-alive */
eb_ops.to_stop = 0; /* to_stop */
eb_ops.to_pid_to_exec_file = NULL;
eb_ops.to_core_file_to_sym_file = NULL;
eb_ops.to_stratum = process_stratum;
eb_ops.DONT_USE = 0; /* next */
eb_ops.to_has_all_memory = 1;

View File

@ -2026,7 +2026,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
es1800_ops.to_thread_alive = 0;
es1800_ops.to_stop = 0;
es1800_ops.to_pid_to_exec_file = NULL;
es1800_ops.to_core_file_to_sym_file = NULL;
es1800_ops.to_stratum = core_stratum;
es1800_ops.DONT_USE = 0;
es1800_ops.to_has_all_memory = 0;
@ -2099,7 +2098,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
es1800_child_ops.to_thread_alive = 0;
es1800_child_ops.to_stop = 0;
es1800_child_ops.to_pid_to_exec_file = NULL;
es1800_child_ops.to_core_file_to_sym_file = NULL;
es1800_child_ops.to_stratum = process_stratum;
es1800_child_ops.DONT_USE = 0;
es1800_child_ops.to_has_all_memory = 1;

View File

@ -1821,7 +1821,6 @@ init_mm_ops (void)
mm_ops.to_thread_alive = 0;
mm_ops.to_stop = 0;
mm_ops.to_pid_to_exec_file = NULL;
mm_ops.to_core_file_to_sym_file = NULL;
mm_ops.to_stratum = process_stratum;
mm_ops.DONT_USE = 0;
mm_ops.to_has_all_memory = 1;

View File

@ -738,7 +738,6 @@ specified when you started GDB.";
nindy_ops.to_thread_alive = 0; /* to_thread_alive */
nindy_ops.to_stop = 0; /* to_stop */
nindy_ops.to_pid_to_exec_file = NULL;
nindy_ops.to_core_file_to_sym_file = NULL;
nindy_ops.to_stratum = process_stratum;
nindy_ops.DONT_USE = 0; /* next */
nindy_ops.to_has_all_memory = 1;

View File

@ -317,7 +317,6 @@ init_nrom_ops (void)
nrom_ops.to_thread_alive = 0;
nrom_ops.to_stop = 0;
nrom_ops.to_pid_to_exec_file = NULL;
nrom_ops.to_core_file_to_sym_file = NULL;
nrom_ops.to_stratum = download_stratum;
nrom_ops.DONT_USE = NULL;
nrom_ops.to_has_all_memory = 1;

View File

@ -1169,7 +1169,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
rombug_ops.to_thread_alive = 0;
rombug_ops.to_stop = 0; /* to_stop */
rombug_ops.to_pid_to_exec_file = NULL;
rombug_ops.to_core_file_to_sym_file = NULL;
rombug_ops.to_stratum = process_stratum;
rombug_ops.DONT_USE = 0; /* next */
rombug_ops.to_has_all_memory = 1;

View File

@ -1433,7 +1433,6 @@ init_remote_rdp_ops (void)
remote_rdp_ops.to_thread_alive = 0;
remote_rdp_ops.to_stop = 0;
remote_rdp_ops.to_pid_to_exec_file = NULL;
remote_rdp_ops.to_core_file_to_sym_file = NULL;
remote_rdp_ops.to_stratum = process_stratum;
remote_rdp_ops.DONT_USE = NULL;
remote_rdp_ops.to_has_all_memory = 1;

View File

@ -915,7 +915,6 @@ init_gdbsim_ops (void)
gdbsim_ops.to_thread_alive = 0;
gdbsim_ops.to_stop = gdbsim_stop;
gdbsim_ops.to_pid_to_exec_file = NULL;
gdbsim_ops.to_core_file_to_sym_file = NULL;
gdbsim_ops.to_stratum = process_stratum;
gdbsim_ops.DONT_USE = NULL;
gdbsim_ops.to_has_all_memory = 1;

View File

@ -807,7 +807,6 @@ the speed to connect at in bits per second.";
st2000_ops.to_thread_alive = 0; /* thread alive */
st2000_ops.to_stop = 0; /* to_stop */
st2000_ops.to_pid_to_exec_file = NULL;
st2000_run_ops.to_core_file_to_sym_file = NULL;
st2000_ops.to_stratum = process_stratum;
st2000_ops.DONT_USE = 0; /* next */
st2000_ops.to_has_all_memory = 1;

View File

@ -503,9 +503,6 @@ cleanup_target (struct target_ops *t)
de_fault (to_pid_to_exec_file,
(char *(*) (int))
return_zero);
de_fault (to_core_file_to_sym_file,
(char *(*) (char *))
return_zero);
de_fault (to_can_async_p,
(int (*) (void))
return_zero);
@ -599,7 +596,6 @@ update_current_target (void)
INHERIT (to_enable_exception_callback, t);
INHERIT (to_get_current_exception_event, t);
INHERIT (to_pid_to_exec_file, t);
INHERIT (to_core_file_to_sym_file, t);
INHERIT (to_stratum, t);
INHERIT (DONT_USE, t);
INHERIT (to_has_all_memory, t);
@ -2873,19 +2869,6 @@ debug_to_pid_to_exec_file (int pid)
return exec_file;
}
static char *
debug_to_core_file_to_sym_file (char *core)
{
char *sym_file;
sym_file = debug_target.to_core_file_to_sym_file (core);
fprintf_unfiltered (gdb_stdlog, "target_core_file_to_sym_file (%s) = %s\n",
core, sym_file);
return sym_file;
}
static void
setup_target_debug (void)
{
@ -2946,7 +2929,6 @@ setup_target_debug (void)
current_target.to_enable_exception_callback = debug_to_enable_exception_callback;
current_target.to_get_current_exception_event = debug_to_get_current_exception_event;
current_target.to_pid_to_exec_file = debug_to_pid_to_exec_file;
current_target.to_core_file_to_sym_file = debug_to_core_file_to_sym_file;
}

View File

@ -294,7 +294,6 @@ struct target_ops
int);
struct exception_event_record *(*to_get_current_exception_event) (void);
char *(*to_pid_to_exec_file) (int pid);
char *(*to_core_file_to_sym_file) (char *);
enum strata to_stratum;
struct target_ops
*DONT_USE; /* formerly to_next */

View File

@ -931,7 +931,6 @@ init_850ice_ops (void)
v850ice_ops.to_thread_alive = NULL;
v850ice_ops.to_stop = v850ice_stop;
v850ice_ops.to_pid_to_exec_file = NULL;
v850ice_ops.to_core_file_to_sym_file = NULL;
v850ice_ops.to_stratum = process_stratum;
v850ice_ops.DONT_USE = NULL;
v850ice_ops.to_has_all_memory = 1;