* exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core".
-Index: gdb-7.1.90.20100711/gdb/exceptions.h
+Index: gdb-7.2.50.20110218/gdb/exceptions.h
===================================================================
---- gdb-7.1.90.20100711.orig/gdb/exceptions.h 2010-05-03 01:52:14.000000000 +0200
-+++ gdb-7.1.90.20100711/gdb/exceptions.h 2010-07-13 22:56:29.000000000 +0200
-@@ -78,6 +78,9 @@ enum errors {
- /* Feature is not supported in this copy of GDB. */
- UNSUPPORTED_ERROR,
+--- gdb-7.2.50.20110218.orig/gdb/exceptions.h 2011-02-14 12:35:44.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/exceptions.h 2011-02-18 10:45:31.000000000 +0100
+@@ -85,6 +85,9 @@ enum errors {
+ traceframe. */
+ NOT_AVAILABLE_ERROR,
+ /* Attempt to load a core file as executable. */
+ IS_CORE_ERROR,
/* Add more errors here. */
NR_ERRORS
};
-Index: gdb-7.1.90.20100711/gdb/exec.c
+Index: gdb-7.2.50.20110218/gdb/exec.c
===================================================================
---- gdb-7.1.90.20100711.orig/gdb/exec.c 2010-07-12 23:07:34.000000000 +0200
-+++ gdb-7.1.90.20100711/gdb/exec.c 2010-07-13 22:56:29.000000000 +0200
+--- gdb-7.2.50.20110218.orig/gdb/exec.c 2011-02-14 23:08:48.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/exec.c 2011-02-18 10:45:16.000000000 +0100
@@ -34,6 +34,7 @@
#include "arch-utils.h"
#include "gdbthread.h"
}
/* FIXME - This should only be run for RS6000, but the ifdef is a poor
-Index: gdb-7.1.90.20100711/gdb/main.c
+Index: gdb-7.2.50.20110218/gdb/main.c
===================================================================
---- gdb-7.1.90.20100711.orig/gdb/main.c 2010-07-12 23:07:34.000000000 +0200
-+++ gdb-7.1.90.20100711/gdb/main.c 2010-07-13 22:58:20.000000000 +0200
-@@ -241,6 +241,36 @@ captured_command_loop (void *data)
+--- gdb-7.2.50.20110218.orig/gdb/main.c 2011-02-18 10:44:17.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/main.c 2011-02-18 10:45:16.000000000 +0100
+@@ -243,6 +243,36 @@ captured_command_loop (void *data)
return 1;
}
static int
captured_main (void *data)
{
-@@ -678,6 +708,8 @@ extern int gdbtk_test (char *);
+@@ -727,6 +757,8 @@ captured_main (void *data)
{
symarg = argv[optind];
execarg = argv[optind];
optind++;
}
-@@ -816,10 +848,25 @@ Excess command line arguments ignored. (
+@@ -868,11 +900,25 @@ captured_main (void *data)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
+ func = exec_file_attach;
+
/* The exec file and the symbol-file are the same. If we can't
-- open it, better only print one error message.
-- catch_command_errors returns non-zero on success! */
-- if (catch_command_errors (exec_file_attach, execarg, !batch_flag, RETURN_MASK_ALL))
-+ open it, better only print one error message.
-+ catch_command_errors returns non-zero on success!
+ open it, better only print one error message.
+- catch_command_errors returns non-zero on success! */
+- if (catch_command_errors (exec_file_attach, execarg,
+- !batch_flag, RETURN_MASK_ALL))
++ catch_command_errors returns non-zero on success!
+ Do not load EXECARG as a symbol file if it has been already processed
+ as a core file. */
+ if (catch_command_errors (func, execarg, !batch_flag, RETURN_MASK_ALL)
+ && core_bfd == NULL)
- catch_command_errors (symbol_file_add_main, symarg, !batch_flag, RETURN_MASK_ALL);
+ catch_command_errors (symbol_file_add_main, symarg,
+ !batch_flag, RETURN_MASK_ALL);
}
- else