130-gdb-ctrl-c.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 63df98fa78c8a6e12b40ebdc5c155838d2bf8b5f Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <[email protected]>
  3. Date: Thu, 29 Nov 2018 18:00:23 -0800
  4. Subject: [PATCH 11/11] gdbserver ctrl-c handling
  5. This problem was created by the upstream commit 78708b7c8c
  6. After applying the commit, it will send SIGINT to the process
  7. group(-signal_pid).
  8. But if we use gdbserver send SIGINT, and the attached process is not a
  9. process
  10. group leader, then the "kill (-signal_pid, SIGINT)" returns error and
  11. fails to
  12. interrupt the attached process.
  13. Upstream-Status: Submitted
  14. [https://sourceware.org/bugzilla/show_bug.cgi?id=18945]
  15. Author: Josh Gao
  16. Signed-off-by: Zhixiong Chi <[email protected]>
  17. Signed-off-by: Khem Raj <[email protected]>
  18. ---
  19. gdbserver/linux-low.cc | 2 +-
  20. 1 file changed, 1 insertion(+), 1 deletion(-)
  21. --- a/gdbserver/linux-low.cc
  22. +++ b/gdbserver/linux-low.cc
  23. @@ -5481,7 +5481,7 @@ linux_process_target::request_interrupt
  24. {
  25. /* Send a SIGINT to the process group. This acts just like the user
  26. typed a ^C on the controlling terminal. */
  27. - int res = ::kill (-signal_pid, SIGINT);
  28. + int res = ::kill (signal_pid, SIGINT);
  29. if (res == -1)
  30. warning (_("Sending SIGINT to process group of pid %ld failed: %s"),
  31. signal_pid, safe_strerror (errno));