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-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>
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);
}
\f
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);
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)
{
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;
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 */
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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);
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);
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)
{
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;
}
\f
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 */
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;