summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/gdb/APKBUILD6
-rw-r--r--system/gdb/stopcode-lock.patch75
2 files changed, 79 insertions, 2 deletions
diff --git a/system/gdb/APKBUILD b/system/gdb/APKBUILD
index b038ca23f..021848629 100644
--- a/system/gdb/APKBUILD
+++ b/system/gdb/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=gdb
pkgver=8.2
-pkgrel=0
+pkgrel=1
pkgdesc="The GNU Debugger"
url="https://www.sourceware.org/gdb/"
arch="all"
@@ -17,6 +17,7 @@ source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
ppc-musl.patch
ppc-ptregs.patch
remove-extraneous-include.patch
+ stopcode-lock.patch
"
build() {
@@ -60,4 +61,5 @@ sha512sums="11cc481bebc51eb6db73249ecb62b8c07455cf3db169f4860b3a83114849fbd2b586
986e68275f7692f39b5d8aedeb9f9e88f0e5bebb3f8c7f104933c525d35ca54fc90e18698c1e3e1009e8a188e5e70d6f252cb39e4c75e37db7bf479017e0da32 s390x-use-elf-gdb_fpregset_t.patch
04911f87904b62dd7662435f9182b20485afb29ddb3d6398a9d31fef13495f7b70639c77fdae3a40e2775e270d7cd40d0cfd7ddf832372b506808d33c8301e01 ppc-musl.patch
b75e1c1ee503a1948a7d5b8d90427b5c7d38ded69978056cee0adca222771a5c95ed1ac73127fcae7b795ea94296344eee5fca47e4cd04b418c164a756fb0933 ppc-ptregs.patch
-3ff31774ba78c1208415289566b901debd815da8b53acefe4a0785e7b2bbcff39585a556d44ff2f7d8d639ebc047620b96e72573acae376d8f23aa98dd1fe286 remove-extraneous-include.patch"
+3ff31774ba78c1208415289566b901debd815da8b53acefe4a0785e7b2bbcff39585a556d44ff2f7d8d639ebc047620b96e72573acae376d8f23aa98dd1fe286 remove-extraneous-include.patch
+720d6cbc71d5d4f5cc8955b18a76661688534d409e2beb53e9e2d2322a303fa622e622b583e1f6c50cf3f32b8abe4f5320a6885e7680769c92ef5bb09ef59d1d stopcode-lock.patch"
diff --git a/system/gdb/stopcode-lock.patch b/system/gdb/stopcode-lock.patch
new file mode 100644
index 000000000..6a4e3d855
--- /dev/null
+++ b/system/gdb/stopcode-lock.patch
@@ -0,0 +1,75 @@
+From: Andrew Burgess <andrew.burgess@embecosm.com>
+Date: Tue, 3 Jul 2018 18:02:48 +0000 (+0100)
+Subject: gdb: Avoid using W_STOPCODE(0) as this is ambiguous on MIPS
+X-Git-Tag: users/ARM/embedded-binutils-master-2018q4~1172
+X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=953473375500a809fbb3eca3efa4dbb670c3a32f
+
+gdb: Avoid using W_STOPCODE(0) as this is ambiguous on MIPS
+
+The MIPS target supports 127 signals, and this can create an ambiguity
+in process wait statuses. A status value of 0x007f could potentially
+indicate a process that has exited with signal 127, or a process that
+has stopped with signal 0.
+
+In uClibc-ng the interpretation of 0x007f is that the process has
+exited with signal 127 rather than stopped with signal 0, and so,
+WIFSTOPPED (W_STOPCODE (0)) will be false rather than true as it would
+be on most other platforms.
+
+Given that it's pretty easy to avoid using W_STOPCODE (0), lets do that.
+
+gdb/ChangeLog:
+
+ * linux-nat.c (linux_nat_target::follow_fork): Avoid using
+ 'W_STOPCODE (0)' as this could be ambiguous.
+---
+
+diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
+index 86d3dfd..d2c88ad 100644
+--- a/gdb/linux-nat.c
++++ b/gdb/linux-nat.c
+@@ -445,7 +445,6 @@ linux_nat_target::follow_fork (int follow_child, int detach_fork)
+ if (!follow_child)
+ {
+ struct lwp_info *child_lp = NULL;
+- int status = W_STOPCODE (0);
+ int has_vforked;
+ ptid_t parent_ptid, child_ptid;
+ int parent_pid, child_pid;
+@@ -465,6 +464,8 @@ linux_nat_target::follow_fork (int follow_child, int detach_fork)
+ /* Detach new forked process? */
+ if (detach_fork)
+ {
++ int child_stop_signal = 0;
++ bool detach_child = true;
+ struct cleanup *old_chain = make_cleanup (delete_lwp_cleanup,
+ child_lp);
+
+@@ -484,18 +485,24 @@ linux_nat_target::follow_fork (int follow_child, int detach_fork)
+ if (!gdbarch_software_single_step_p (target_thread_architecture
+ (parent_ptid)))
+ {
++ int status;
++
+ linux_disable_event_reporting (child_pid);
+ if (ptrace (PTRACE_SINGLESTEP, child_pid, 0, 0) < 0)
+ perror_with_name (_("Couldn't do single step"));
+ if (my_waitpid (child_pid, &status, 0) < 0)
+ perror_with_name (_("Couldn't wait vfork process"));
++ else
++ {
++ detach_child = WIFSTOPPED (status);
++ child_stop_signal = WSTOPSIG (status);
++ }
+ }
+
+- if (WIFSTOPPED (status))
++ if (detach_child)
+ {
+- int signo;
++ int signo = child_stop_signal;
+
+- signo = WSTOPSIG (status);
+ if (signo != 0
+ && !signal_pass_state (gdb_signal_from_host (signo)))
+ signo = 0;