aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-11-30 16:05:17 +0000
committerPedro Alves <palves@redhat.com>2015-11-30 18:37:55 +0000
commitde979965d3f5de7e4bf2354871fe85b3f77c720e (patch)
tree68510e41aebe512f3203089e9b7daa8c0dc61a69 /gdb/gdbserver/server.c
parent799a2abe613be0645b84f5aaa050f2f91e6ae3f7 (diff)
downloadfsf-binutils-gdb-de979965d3f5de7e4bf2354871fe85b3f77c720e.zip
fsf-binutils-gdb-de979965d3f5de7e4bf2354871fe85b3f77c720e.tar.gz
fsf-binutils-gdb-de979965d3f5de7e4bf2354871fe85b3f77c720e.tar.bz2
New vCtrlC packet, non-stop mode equivalent of \003
There's currently no non-stop equivalent of the all-stop ^C (\003) "packet" that GDB sends when a ctrl-c is pressed while a foreground command is active. There's vCont;t, but that's defined to cause a "signal 0" stop. This fixes many tests that type ^C, when testing with extended-remote with "maint set target-non-stop on". E.g.: Continuing. talk to me baby PASS: gdb.base/interrupt.exp: process is alive a a PASS: gdb.base/interrupt.exp: child process ate our char ^C [Thread 22730.22730] #1 stopped. 0x0000003615ee6650 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:81 81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) (gdb) FAIL: gdb.base/interrupt.exp: send_gdb control C p func1 () gdb/ 2015-11-30 Pedro Alves <palves@redhat.com> * NEWS (New remote packets): Mention vCtrlC. * remote.c (PACKET_vCtrlC): New enum value. (async_remote_interrupt): Call target_interrupt instead of target_stop. (remote_interrupt_as): Remove 'ptid' parameter. (remote_interrupt_ns): New function. (remote_stop): Adjust. (remote_interrupt): If the target is in non-stop mode, try interrupting with vCtrlC. (initialize_remote): Install set remote ctrl-c packet. gdb/doc/ 2015-11-30 Pedro Alves <palves@redhat.com> * gdb.texinfo (Bootstrapping): Add "interrupting remote targets" anchor. (Packets): Document vCtrlC. gdb/gdbserver/ 2015-11-30 Pedro Alves <palves@redhat.com> * server.c (handle_v_requests): Handle vCtrlC.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 9d65f65..f6245d7 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2861,6 +2861,13 @@ handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
{
if (!disable_packet_vCont)
{
+ if (strcmp (own_buf, "vCtrlC") == 0)
+ {
+ (*the_target->request_interrupt) ();
+ write_ok (own_buf);
+ return;
+ }
+
if (startswith (own_buf, "vCont;"))
{
require_running (own_buf);