diff options
author | Pedro Alves <palves@redhat.com> | 2013-03-28 21:58:02 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-03-28 21:58:02 +0000 |
commit | 948bd7ac017364916424806e5cd39d211affe407 (patch) | |
tree | 085f1e76a51c1bc5dfa2877d1d97c26742acba61 | |
parent | e6c081ab2f37103e33d261618ab01650a55d9ae0 (diff) | |
download | gdb-948bd7ac017364916424806e5cd39d211affe407.tar.gz |
Stop sending qTStatus if the target doesn't recognize it; add packet configuration command.
GDB currently sends a qTStatus even if the target previously replied
an empty packet to a previous qTStatus. If the target doesn't
recognize the packet, there's no point in trying again.
The machinery we have in place is packet_ok, which has the nice side
effect of forcing one to install a configuration command/knob for the
packet in question, which is often handy when you need to debug
things, and/or emulate a target that doesn't support the packet, or even,
it can be used as workaround for the old broken kgdb's that return error
to qTSTatus instead of an empty packet.
gdb/
2013-03-28 Pedro Alves <palves@redhat.com>
* NEWS (New options): New section.
(New options): Mention set/show remote trace-status-packet.
* remote.c (PACKET_qTStatus): New enumeration value.
(remote_get_trace_status): Skip sending qTStatus if the packet is
disabled. Use packet_ok.
(_initialize_remote): Register a configuration command for
qTStatus packet.
gdb/doc/
2013-03-28 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Remote Configuration) <set remote @var{name}-packet
table>: Add entry for "trace-status".
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/NEWS | 6 | ||||
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 4 | ||||
-rw-r--r-- | gdb/remote.c | 12 |
5 files changed, 36 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f8c393b9b5b..8b3f369180a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2013-03-28 Pedro Alves <palves@redhat.com> + + * NEWS (New options): New section. + (New options): Mention set/show remote trace-status-packet. + * remote.c (PACKET_qTStatus): New enumeration value. + (remote_get_trace_status): Skip sending qTStatus if the packet is + disabled. Use packet_ok. + (_initialize_remote): Register a configuration command for + qTStatus packet. + 2013-03-28 Doug Evans <dje@google.com> * symfile.c (find_separate_debug_file): Add comment. @@ -10,6 +10,12 @@ maint set|show per-command time maint set|show per-command symtab Enable display of per-command gdb resource usage. +* New options + +set remote trace-status-packet +show remote trace-status-packet + Set/show the use of remote protocol qTStatus packet. + * The command 'tsave' can now support new option '-ctf' to save trace buffer in Common Trace Format. diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 31593d4f4b3..8402495b4a1 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2013-03-28 Pedro Alves <palves@redhat.com> + + * gdb.texinfo (Remote Configuration) <set remote @var{name}-packet + table>: Add entry for "trace-status". + 2013-03-28 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Maintenance Commands): Use @enumerate, not "@table diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index dec27a82bed..3b63d015e69 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -18445,6 +18445,10 @@ are: @tab @code{qAttached} @tab Querying remote process attach state. +@item @code{trace-status} +@tab @code{qTStatus} +@tab @code{tstatus} + @item @code{traceframe-info} @tab @code{qXfer:traceframe-info:read} @tab Traceframe info diff --git a/gdb/remote.c b/gdb/remote.c index 865995378d7..b8a7a1af0e6 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1256,6 +1256,7 @@ enum { PACKET_qGetTIBAddr, PACKET_qGetTLSAddr, PACKET_qSupported, + PACKET_qTStatus, PACKET_QPassSignals, PACKET_QProgramSignals, PACKET_qSearch_memory, @@ -10689,6 +10690,10 @@ remote_get_trace_status (struct trace_status *ts) /* FIXME we need to get register block size some other way. */ extern int trace_regblock_size; volatile struct gdb_exception ex; + enum packet_result result; + + if (remote_protocol_packets[PACKET_qTStatus].support == PACKET_DISABLE) + return -1; trace_regblock_size = get_remote_arch_state ()->sizeof_g_packet; @@ -10707,8 +10712,10 @@ remote_get_trace_status (struct trace_status *ts) throw_exception (ex); } + result = packet_ok (p, &remote_protocol_packets[PACKET_qTStatus]); + /* If the remote target doesn't do tracing, flag it. */ - if (*p == '\0') + if (result == PACKET_UNKNOWN) return -1; /* We're working with a live target. */ @@ -11876,6 +11883,9 @@ Show the maximum size of the address (in bits) in a memory packet."), NULL, add_packet_config_cmd (&remote_protocol_packets[PACKET_qSearch_memory], "qSearch:memory", "search-memory", 0); + add_packet_config_cmd (&remote_protocol_packets[PACKET_qTStatus], + "qTStatus", "trace-status", 0); + add_packet_config_cmd (&remote_protocol_packets[PACKET_vFile_open], "vFile:open", "hostio-open", 0); |