This file is part of GDB.
-GDB is free software; you can redistribute it and/or modify
+This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <errno.h>
/* Discard all vestiges of any previous core file
and mark data and stack spaces as empty. */
+/* ARGSUSED */
void
core_close (quitting)
int quitting;
free (bfd_get_filename (core_bfd));
bfd_close (core_bfd);
core_bfd = NULL;
+#ifdef CLEAR_SOLIB
+ CLEAR_SOLIB ();
+#endif
}
}
bfd_errmsg (bfd_error));
ontop = !push_target (&core_ops);
+ make_cleanup (unpush_target, &core_ops);
p = bfd_core_file_failing_command (core_bfd);
if (p)
if (ontop) {
/* Fetch all registers from core file */
target_fetch_registers (-1);
+ /* Add symbols for any shared libraries that were in use */
+#ifdef SOLIB_ADD
+ SOLIB_ADD (NULL, from_tty);
+#endif
+ /* Now, set up the frame cache, and print the top of stack */
set_current_frame ( create_new_frame (read_register (FP_REGNUM),
read_pc ()));
select_frame (get_current_frame (), 0);
- /* FIXME, handle shared library reading here. */
print_sel_frame (0); /* Print the top frame and source line */
} else {
printf (
int len;
int write;
{
- return xfer_memory (memaddr, myaddr, len, write,
+ int res;
+ res = xfer_memory (memaddr, myaddr, len, write,
core_bfd, core_sections, core_sections_end);
+#ifdef SOLIB_XFER_MEMORY
+ if (res == 0)
+ res = SOLIB_XFER_MEMORY (memaddr, myaddr, len, write);
+#endif
+ return res;
}
\f
/* Get the registers out of a core file. This is the machine-
independent part. Fetch_core_registers is the machine-dependent
part, typically implemented in the xm-file for each architecture. */
-static int
+/* We just get all the registers, so we don't use regno. */
+/* ARGSUSED */
+static void
get_core_registers (regno)
int regno;
{
}
}
registers_fetched();
- return 0; /* FIXME, what result goes here? */
}
\f
struct target_ops core_ops = {