Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: remote.c : allow long monitor cmds + allow user to C-c
@ 2012-01-23  9:42 Philippe Waroquiers
  2012-01-23 12:43 ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: Philippe Waroquiers @ 2012-01-23  9:42 UTC (permalink / raw)
  To: gdb-patches@sourceware.org ml

The remote stub can implement monitor commands which are not
known by gdb. Such monitor commands can take a long time
to execute. An example of this is the "leak_search" monitor
command implemented in the Valgrind gdbserver.

Currently, gdb will timeout on such a monitor command.
The remote stub however will continue to execute the
command and send the output later. Gdb and the remote
stub can then be desynchronised : gdb sends a packet,
and the reply read from the stub is a previous packet.

The change below uses getpkt_sane to detect a timeout.
In this case, it continues the loop.
A QUIT; is inserted in the loop to allow the user
to stop handling the current command. possibly
still creating a desynchronisation between gdb and the stub
but that will be upon user request.

Regression tested on linux x86, with and without gdbserver.

Ok to apply ?

Philippe

Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.13761
diff -r1.13761 ChangeLog
0a1,5
> 2012-01-22  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
> 
> 	* remote.c (remote_rcmd): use getpkt_sane to detect timeout
> 	and continue the loop. Add QUIT statement.
> 
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.478
diff -r1.478 remote.c
8585a8586
>       QUIT;			/* Allow user to bail out with ^C.  */
8587c8588,8596
<       getpkt (&rs->buf, &rs->buf_size, 0);
---
>       if (getpkt_sane (&rs->buf, &rs->buf_size, 0) == -1)
>         { 
>           /* Timeout. Continue to (try to) read responses.
>              This is better than stopping with an error, assuming the stub
>              is still executing the (long) monitor command.
>              If needed, the user can interrupt gdb using C-c, obtaining
>              an effect similar to stop on timeout.  */
>           continue;
>         }



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-02-06 19:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-23  9:42 RFA: remote.c : allow long monitor cmds + allow user to C-c Philippe Waroquiers
2012-01-23 12:43 ` Pedro Alves
2012-01-23 21:09   ` Philippe Waroquiers
2012-01-24  4:43     ` Sergio Durigan Junior
2012-01-24  4:52       ` Philippe Waroquiers
2012-02-02 22:13       ` (ping) " Philippe Waroquiers
2012-02-03 20:28         ` Stan Shebs
2012-02-03 22:39           ` Philippe Waroquiers
2012-02-06 19:38             ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox