From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
-Subject: print a more useful error message for "gdb core"
-
-FileName: gdb-6.6-buildid-locate-core-as-arg.patch
+Subject: gdb-6.6-buildid-locate-core-as-arg.patch
;;=push+jan
* exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core".
----
- gdb/common/common-exceptions.h | 3 +++
- gdb/exec.c | 22 +++++++++++++++---
- gdb/main.c | 53 +++++++++++++++++++++++++++++++++++++++---
- 3 files changed, 72 insertions(+), 6 deletions(-)
diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
-index 15c85e28ab..9fe2375bce 100644
--- a/gdb/common/common-exceptions.h
+++ b/gdb/common/common-exceptions.h
@@ -104,6 +104,9 @@ enum errors {
NR_ERRORS
};
diff --git a/gdb/exec.c b/gdb/exec.c
-index c8c32ecc27..b329e2b834 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
-@@ -35,6 +35,7 @@
- #include "progspace.h"
+@@ -36,6 +36,7 @@
#include "gdb_bfd.h"
#include "gcore.h"
+ #include "source.h"
+#include "exceptions.h"
#include <fcntl.h>
#include "readline/readline.h"
-@@ -346,12 +347,27 @@ exec_file_attach (const char *filename, int from_tty)
+@@ -357,12 +358,27 @@ exec_file_attach (const char *filename, int from_tty)
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{
if (build_section_table (exec_bfd, §ions, §ions_end))
diff --git a/gdb/main.c b/gdb/main.c
-index 3c98787edb..17d35f4a8a 100644
--- a/gdb/main.c
+++ b/gdb/main.c
-@@ -446,6 +446,37 @@ struct cmdarg
+@@ -447,6 +447,37 @@ struct cmdarg
char *string;
};
static void
captured_main_1 (struct captured_main_args *context)
{
-@@ -882,6 +913,8 @@ captured_main_1 (struct captured_main_args *context)
+@@ -883,6 +914,8 @@ captured_main_1 (struct captured_main_args *context)
{
symarg = argv[optind];
execarg = argv[optind];
optind++;
}
-@@ -1032,11 +1065,25 @@ captured_main_1 (struct captured_main_args *context)
+@@ -1033,11 +1066,25 @@ captured_main_1 (struct captured_main_args *context)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
catch_command_errors (symbol_file_add_main_adapter, symarg,
!batch_flag);
}
---
-2.14.3
-