[06/18] New vCtrlC packet, non-stop mode equivalent of \003

Message ID 565C94A4.5090005@redhat.com
State New, archived
Headers

Commit Message

Pedro Alves Nov. 30, 2015, 6:25 p.m. UTC
  I see now that I never responded to this one...

On 10/26/2015 11:44 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
>> gdb/
>> 2015-10-14  Pedro Alves  <palves@redhat.com>
>>
>> 	* NEWS (New remote packets): Mention vCtrlC.
>>
>> gdb/doc/
>> 2015-10-14  Pedro Alves  <palves@redhat.com>
>>
>> 	* gdb.texinfo (Bootstrapping): Add
>> 	"interrupting remote targets" anchor.
>> 	(Packets): Document vCtrlC.
>>
>> gdb/gdbserver/
>> 2015-10-14  Pedro Alves  <palves@redhat.com>
>>
>> 	* server.c (handle_v_requests): Handle vCtrlC.
> 
> These entries below should be hoisted above to gdb/ChangeLog,

Whoops, indeed.

> 
>> 	* 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/NEWS               |  4 ++++
>>  gdb/doc/gdb.texinfo    | 34 +++++++++++++++++++++++----
>>  gdb/gdbserver/server.c |  7 ++++++
>>  gdb/remote.c           | 64 ++++++++++++++++++++++++++++++++++++++++++++------
>>  4 files changed, 98 insertions(+), 11 deletions(-)
>>
> 
>>  
>> +/* Non-stop version of target_interrupt.  Uses `vCtrlC' to interrupt
>> +   the remote target.  It is undefined which thread of which process
>> +   reports the interrupt.  */
>> +
> 
> We need to document the return value of this function in comments.

I've added this:


> Patch looks good to me otherwise.

Thanks,
Pedro Alves
  

Patch

diff --git i/gdb/remote.c w/gdb/remote.c
index ae8c708..7256c23 100644
--- i/gdb/remote.c
+++ w/gdb/remote.c
@@ -5709,7 +5709,8 @@  remote_interrupt_as (void)

 /* Non-stop version of target_interrupt.  Uses `vCtrlC' to interrupt
    the remote target.  It is undefined which thread of which process
-   reports the interrupt.  */
+   reports the interrupt.  Returns true if the packet is supported by
+   the server, false otherwise.  */

 static int
 remote_interrupt_ns (void)