diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch new file mode 100644 index 0000000..327ddf9 --- /dev/null +++ b/gdb-container-rh-pkg.patch @@ -0,0 +1,41 @@ +--- gdb-7.11/gdb/linux-thread-db.c.orig 2016-04-06 17:45:10.444062076 +0200 ++++ gdb-7.11/gdb/linux-thread-db.c 2016-04-06 17:46:16.169615943 +0200 +@@ -1025,7 +1025,16 @@ check_pid_namespace_match (void) + warning (_ ("Target and debugger are in different PID " + "namespaces; thread lists and other data are " + "likely unreliable. " +- "Connect to gdbserver inside the container.")); ++ "Connect to gdbserver inside the container.\n" ++"This version of GDB needs local access to files from the container. It is easier to access the files from the container itself. This RHEL-7 version of GDB does not support such direct container files access.\n" ++"The following versions of GDB support the direct access:\n" ++"- Upstream version of GDB (unsupported) 7.10 or later\n" ++"- Red Hat Developer Toolset (DTS) version of GDB from DTS 4.0 or later (available only for the x86_64 architecture)\n" ++"The direct container file access needs to be supported also by gdbserver inside the container:\n" ++"- Upstream version of gdbserver (unsupported) 7.10 or later\n" ++"- Red Hat Developer Toolset (DTS) version of gdbserver from DTS 4.0 or later (only on x86_64)\n" ++"- RHEL-7.3 version of gdbserver (on any architecture)" ++)); + } + } + } +--- gdb-7.11/gdb/remote.c-orig 2016-04-06 17:46:52.428921496 +0200 ++++ gdb-7.11/gdb/remote.c 2016-04-06 18:28:26.781923516 +0200 +@@ -13002,7 +13002,17 @@ remote_pid_to_exec_file (struct target_o + char *annex = NULL; + + if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) +- return NULL; ++ { ++ warning (_("Remote gdbserver does not support determining executable " ++ "automatically.\n" ++"RHEL <=6.8 and <=7.2 versions of gdbserver do not support such automatic executable detection.\n" ++"The following versions of gdbserver support it:\n" ++"- Upstream version of gdbserver (unsupported) 7.10 or later\n" ++"- Red Hat Developer Toolset (DTS) version of gdbserver from DTS 4.0 or later (only on x86_64)\n" ++"- RHEL-6.9 and RHEL-7.3 versions of gdbserver (on any architecture)" ++)); ++ return NULL; ++ } + + if (filename != NULL) + xfree (filename); diff --git a/gdb-upstream.patch b/gdb-upstream.patch index e60e67a..18493ff 100644 --- a/gdb-upstream.patch +++ b/gdb-upstream.patch @@ -213,3 +213,76 @@ index 1eb457d..21166bf 100644 --azLHFNyN32YCQGCU-- + + +commit fef3cb9f3aa84018d10866f89228ae3f23e5ca7e +Author: Jan Kratochvil +Date: Wed Apr 6 15:57:08 2016 +0200 + + Print the "file" command suggestion in exec_file_locate_attach + + currently: + $ gdbserver-7.9 :1234 true & + $ gdb -q -ex 'target remote :1234' # that -q is not relevant here + Remote debugging using :1234 + warning: Could not load vsyscall page because no executable was specified + try using the "file" command first. + 0x00007ffff7ddcc80 in ?? () + (gdb) b main + No symbol table is loaded. Use the "file" command. + Make breakpoint pending on future shared library load? (y or [n]) _ + + Provide more suggestive message to use the "file" command. + + gdb/ChangeLog + 2016-04-06 Jan Kratochvil + Pedro Alves + + * exec.c (exec_file_locate_attach): Print warning for unsupported + target_pid_to_exec_file. + * symfile-mem.c (add_vsyscall_page): Remove the "file" command + message part. + +### a/gdb/ChangeLog +### b/gdb/ChangeLog +## -1,3 +1,11 @@ ++2016-04-06 Jan Kratochvil ++ Pedro Alves ++ ++ * exec.c (exec_file_locate_attach): Print warning for unsupported ++ target_pid_to_exec_file. ++ * symfile-mem.c (add_vsyscall_page): Remove the "file" command ++ message part. ++ + 2016-04-04 Simon Marchi + + * cli/cli-decode.c (help_cmd_list): Fix function doc and remove +--- a/gdb/exec.c ++++ b/gdb/exec.c +@@ -151,7 +151,13 @@ exec_file_locate_attach (int pid, int from_tty) + /* Try to determine a filename from the process itself. */ + exec_file = target_pid_to_exec_file (pid); + if (exec_file == NULL) +- return; ++ { ++ warning (_("No executable has been specified and target does not " ++ "support\n" ++ "determining executable automatically. " ++ "Try using the \"file\" command.")); ++ return; ++ } + + /* If gdb_sysroot is not empty and the discovered filename + is absolute then prefix the filename with gdb_sysroot. */ +--- a/gdb/symfile-mem.c ++++ b/gdb/symfile-mem.c +@@ -214,8 +214,7 @@ add_vsyscall_page (struct target_ops *target, int from_tty) + format should fix this. */ + { + warning (_("Could not load vsyscall page " +- "because no executable was specified\n" +- "try using the \"file\" command first.")); ++ "because no executable was specified")); + return; + } + args.bfd = bfd; diff --git a/gdb.spec b/gdb.spec index 3c55821..caabb48 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.11 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 64%{?dist} +Release: 65%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -557,6 +557,9 @@ Patch1113: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch # Fix non-stop gdb -p : internal error (pedro Alves, RH BZ 1318049). Patch1117: gdb-rhbz1318049-gdb-p-container-internal-error.patch +# Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). +Patch1118: gdb-container-rh-pkg.patch + %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: # Patch642: gdb-readline62-ask-more-rh.patch @@ -864,6 +867,7 @@ find -name "*.info*"|xargs rm -f %patch1075 -p1 %patch1113 -p1 %patch1117 -p1 +%patch1118 -p1 %if 0%{?rhel:1} && 0%{?rhel} <= 7 %patch1044 -p1 @@ -1381,8 +1385,11 @@ then fi %changelog +* Wed Apr 6 2016 Jan Kratochvil - 7.11-65.fc24 +- Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114). + * Wed Apr 6 2016 Jan Kratochvil - 7.11-64.fc24 -- Fix non-stop gdb -p : internal error (pedro Alves, RH BZ 1318049). +- Fix non-stop gdb -p : internal error (Pedro Alves, RH BZ 1318049). * Sat Mar 19 2016 Jan Kratochvil - 7.11-63.fc24 - .spec cleanup: Drop strict-aliasing GCC bug workaround (from RH BZ 1315191).