summaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>2010-03-18 21:23:32 +0000
committerStan Shebs <shebs@apple.com>2010-03-18 21:23:32 +0000
commit175ca91d848088ffa726d1893e373fb6c22b28ec (patch)
tree25e1036edc6f82e242c9a03a6e1cd037178a9acc /gdb/remote.c
parent824eed9133dacbdeadbdd89621306c8172855b6c (diff)
downloadgdb-175ca91d848088ffa726d1893e373fb6c22b28ec.tar.gz
2010-03-18 Stan Shebs <stan@codesourcery.com>
Pedro Alves <pedro@codesourcery.com> * target.h (struct target_ops): New method to_set_circular_trace_buffer. (target_set_circular_trace_buffer): New macro. * target.c (update_current_target): Add to_set_circular_trace_buffer, fix to_set_disconnected_tracing default behavior. * remote.c (remote_set_circular_trace_buffer): New function. (init_remote_ops): Add it to vector. * tracepoint.h (struct trace_status): New field traceframes_created, change buffer_size and buffer_free to int. * tracepoint.c (circular_trace_buffer): New global. (start_tracing): Send values of disconnected tracing and circular trace buffer settings. (set_circular_trace_buffer): New function. (parse_trace_state): Handle total space and frames created. (trace_status_command): Display total space and total frames created. (trace_save): Write out new status values. (parse_trace_status): Set traceframe_count, traceframes_created, buffer_free and buffer_size to -1 by default. (_initialize_tracepoint): New setshow for circular-trace-buffer. * NEWS: Mention the circular trace buffer option. * gdb.texinfo (Starting and Stopping Trace Experiments): Describe circular-trace-buffer. (Tracepoint Packets): Describe QTBuffer, and details of the qTStatus reply. * gdb.trace/circ.exp: Test circular-trace-buffer. * gdb.trace/tfile.exp: Update tstatus test.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 01d558cb32b..024b6296dcc 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9659,6 +9659,18 @@ remote_core_of_thread (struct target_ops *ops, ptid_t ptid)
}
static void
+remote_set_circular_trace_buffer (int val)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ sprintf (rs->buf, "QTBuffer:circular:%x", val);
+ putpkt (rs->buf);
+ remote_get_noisy_reply (&target_buf, &target_buf_size);
+ if (strcmp (target_buf, "OK"))
+ error (_("Target does not support this command."));
+}
+
+static void
init_remote_ops (void)
{
remote_ops.to_shortname = "remote";
@@ -9736,6 +9748,7 @@ Specify the serial device it is connected to\n\
remote_ops.to_upload_trace_state_variables = remote_upload_trace_state_variables;
remote_ops.to_get_raw_trace_data = remote_get_raw_trace_data;
remote_ops.to_set_disconnected_tracing = remote_set_disconnected_tracing;
+ remote_ops.to_set_circular_trace_buffer = remote_set_circular_trace_buffer;
remote_ops.to_core_of_thread = remote_core_of_thread;
}