summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorZhixiong Chi <zhixiong.chi@windriver.com>2018-09-18 19:26:35 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-20 05:41:32 -0700
commit9eb4e056c52094d6badd5f3b8f7bd3c8a49393b2 (patch)
tree31fc7b2156479faec3184c05b04c53bd5bc73fb0 /meta/recipes-devtools
parent7796602c9569121101aef81916f193078e0d9600 (diff)
downloadpoky-9eb4e056c52094d6badd5f3b8f7bd3c8a49393b2.tar.gz
gdb: gdbserver: update ctrl-c handling
A) gdbserver sends SIGINT not to the process, but to the process group (-signal_pid). But the attached process is not always a process group leader. If not, "kill (-signal_pid, SIGINT)" returns error and fails to interrupt the attached process. We cannot interrupt the process attached with gdbserver who is not a process group leader. This problem was created by the gdb upstream commit 78708b7c8c The commit fixed the following case B) bug. B) We cannot interrupt the process attached with gdbserver whose main thread exits (pthread_exit()). Now this patch can solve both A) and B). (From OE-Core rev: 435f671981a090bd06e8f3bf3436d58d531afd49) Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/gdb/gdb-8.2.inc1
-rw-r--r--meta/recipes-devtools/gdb/gdb/gdbserver-ctrl-c-handling.patch26
2 files changed, 27 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gdb/gdb-8.2.inc b/meta/recipes-devtools/gdb/gdb-8.2.inc
index 999fdde031..dfb0059123 100644
--- a/meta/recipes-devtools/gdb/gdb-8.2.inc
+++ b/meta/recipes-devtools/gdb/gdb-8.2.inc
@@ -16,6 +16,7 @@ SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
16 file://0009-Change-order-of-CFLAGS.patch \ 16 file://0009-Change-order-of-CFLAGS.patch \
17 file://0010-resolve-restrict-keyword-conflict.patch \ 17 file://0010-resolve-restrict-keyword-conflict.patch \
18 file://0011-Fix-invalid-sigprocmask-call.patch \ 18 file://0011-Fix-invalid-sigprocmask-call.patch \
19 file://gdbserver-ctrl-c-handling.patch \
19" 20"
20SRC_URI[md5sum] = "b5a49dbff00d9a87fbe114d14b3101c0" 21SRC_URI[md5sum] = "b5a49dbff00d9a87fbe114d14b3101c0"
21SRC_URI[sha256sum] = "c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39" 22SRC_URI[sha256sum] = "c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39"
diff --git a/meta/recipes-devtools/gdb/gdb/gdbserver-ctrl-c-handling.patch b/meta/recipes-devtools/gdb/gdb/gdbserver-ctrl-c-handling.patch
new file mode 100644
index 0000000000..dffb0dd81f
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/gdbserver-ctrl-c-handling.patch
@@ -0,0 +1,26 @@
1+This problem was created by the upstream commit 78708b7c8c
2+After applying the commit, it will send SIGINT to the process group(-signal_pid).
3+But if we use gdbserver send SIGINT, and the attached process is not a process
4+group leader, then the "kill (-signal_pid, SIGINT)" returns error and fails to
5+interrupt the attached process.
6+
7+Upstream-Status: Submitted
8+[https://sourceware.org/bugzilla/show_bug.cgi?id=18945]
9+
10+Author: Josh Gao
11+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
12Index: gdb-8.2/gdb/gdbserver/linux-low.c
13===================================================================
14--- gdb-8.2.orig/gdb/gdbserver/linux-low.c
15+++ gdb-8.2/gdb/gdbserver/linux-low.c
16@@ -5940,9 +5940,7 @@ linux_look_up_symbols (void)
17 static void
18 linux_request_interrupt (void)
19 {
20- /* Send a SIGINT to the process group. This acts just like the user
21- typed a ^C on the controlling terminal. */
22- kill (-signal_pid, SIGINT);
23+ kill (signal_pid, SIGINT);
24 }
25
26 /* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET