Thanks
Philippe
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.13804
diff -u -p -r1.13804 ChangeLog
--- gdb/ChangeLog 2 Feb 2012 20:19:02 -0000 1.13804
+++ gdb/ChangeLog 2 Feb 2012 22:05:35 -0000
@@ -1,3 +1,8 @@
+2012-02-02 Philippe Waroquiers<philippe.waroquiers@skynet.be>
+
+ * remote.c (remote_rcmd): Use getpkt_sane to detect timeout
+ and continue the loop. Add QUIT statement.
+
2012-02-02 Doug Evans<dje@google.com>
* blockframe.c (find_pc_partial_function_gnu_ifunc): Change type of
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.481
diff -u -p -r1.481 remote.c
--- gdb/remote.c 2 Feb 2012 18:04:29 -0000 1.481
+++ gdb/remote.c 2 Feb 2012 22:05:36 -0000
@@ -8590,8 +8590,17 @@ remote_rcmd (char *command,
char *buf;
/* XXX - see also remote_get_noisy_reply(). */
+ QUIT; /* Allow user to bail out with ^C. */
rs->buf[0] = '\0';
- 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;
+ }
buf = rs->buf;
if (buf[0] == '\0')
error (_("Target does not support this command."));