From 2001-07-23 Andreas Schwab <schwab@suse.de>:
[deliverable/binutils-gdb.git] / gdb / corefile.c
index 0d6964bd37bfb325d2cb221f8d307ce255fcd710..51a3b03568b48af3b5d2aead0d9c7a8b45c1cb0d 100644 (file)
 #include <errno.h>
 #include <signal.h>
 #include <fcntl.h>
-#include "frame.h"             /* required by inferior.h */
 #include "inferior.h"
 #include "symtab.h"
 #include "command.h"
 #include "gdbcmd.h"
-#include "symfile.h"
 #include "bfd.h"
 #include "target.h"
 #include "gdbcore.h"
 #include "dis-asm.h"
-#include "language.h"
 #include "gdb_stat.h"
-#include "symfile.h"
-#include "objfiles.h"
 #include "completer.h"
 
 /* Local function declarations.  */
@@ -75,35 +70,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);
 }
 \f
 
This page took 0.023674 seconds and 4 git commands to generate.