From 65b07ddca8832033e0e102c3a2a0d9f9f5922a9d Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 31 Dec 1998 21:58:30 +0000 Subject: all remaining *.c *.h files from hp merge. --- gdb/corefile.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'gdb/corefile.c') diff --git a/gdb/corefile.c b/gdb/corefile.c index 8ffe49d2e95..94e56ebffec 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -34,6 +34,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "dis-asm.h" #include "language.h" #include "gdb_stat.h" +#include "symfile.h" +#include "objfiles.h" extern char registers[]; @@ -76,7 +78,29 @@ core_file_command (filename, from_tty) if (!filename) (t->to_detach) (filename, from_tty); else - (t->to_open) (filename, from_tty); + { + /* 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 = strdup (symfile); + + make_cleanup (free, symfile_copy); + symbol_file_command (symfile_copy, from_tty); + } + else + warning ("Unknown symbols for '%s'; use the 'symbol-file' command.", filename); + } +#endif + (t->to_open) (filename, from_tty); + } else error ("GDB can't read core files on this machine."); } -- cgit v1.2.1