Include putpkt in TRY_CATCH. PR gdb/51275

Gareth McMullin
2013-03-14T02:02:58Z

If debugging with a remote connection over a serial link and the link is
disconnected, say by disconnecting USB serial port, the GDB quit command no
longer works.

Including the call to putpkt in the TRY_CATCH in remote_get_trace_status
allows the exception to be caught and reported, but still allows GDB to exit
on the quit command.

This fixes bug 15275 and probably 11221 which I believe is the same problem.

gdb:

2013-03-14 Gareth McMullin <gareth@blacksphere.co.nz>

PR gdb/15275
* remote.c (remote_get_trace_status): Include putpkt in TRY_CATCH.

---
diff --git a/gdb/remote.c b/gdb/remote.c
index 21d86f7..29c64c0 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -10695,10 +10695,9 @@ remote_get_trace_status (struct trace_status *ts)

trace_regblock_size = get_remote_arch_state ()->sizeof_g_packet;

- putpkt ("qTStatus");
-
TRY_CATCH (ex, RETURN_MASK_ERROR)
{
+ putpkt ("qTStatus");
p = remote_get_noisy_reply (&target_buf, &target_buf_size);
}
if (ex.reason < 0)