From f224b49dcd9afdff4cc97bbb6d88dec3b4dfc433 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 23 Mar 2010 21:46:33 +0000 Subject: -trace-start/-trace-end/-trace-status. * mi/mi-cmds.c (mi_cmds): Register -trace-start, -trace-status and -trace-stop. * mi/mi-cmds.h (mi_cmd_trace_start, mi_cmd_trace_status) (mi_cmd_trace_stop): Declare. * mi/mi-main.c (mi_cmd_trace_start, mi_cmd_trace_status) (mi_cmd_trace_stop): New. * tracepoint.c (start_tracing): New, extracted from... (trace_start_command): ...this. (trace_status_mi): New. * tracepoint.h (struct trace_status): Document stopping_tracepoint. (start_tracing, stop_tracing, trace_status_mi): Declare. --- gdb/mi/mi-cmds.c | 3 +++ gdb/mi/mi-cmds.h | 3 +++ gdb/mi/mi-main.c | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+) (limited to 'gdb/mi') diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index 7f18d94..c2183fb 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -105,6 +105,9 @@ struct mi_cmd mi_cmds[] = { "thread-info", { NULL, 0 }, mi_cmd_thread_info }, { "thread-list-ids", { NULL, 0 }, mi_cmd_thread_list_ids}, { "thread-select", { NULL, 0 }, mi_cmd_thread_select}, + { "trace-start", { NULL, 0 }, mi_cmd_trace_start }, + { "trace-status", { NULL, 0 }, mi_cmd_trace_status }, + { "trace-stop", { NULL, 0 }, mi_cmd_trace_stop }, { "var-assign", { NULL, 0 }, mi_cmd_var_assign}, { "var-create", { NULL, 0 }, mi_cmd_var_create}, { "var-delete", { NULL, 0 }, mi_cmd_var_delete}, diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 20bdbfd..702dd9e 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -88,6 +88,9 @@ extern mi_cmd_argv_ftype mi_cmd_target_file_delete; extern mi_cmd_argv_ftype mi_cmd_thread_info; extern mi_cmd_argv_ftype mi_cmd_thread_list_ids; extern mi_cmd_argv_ftype mi_cmd_thread_select; +extern mi_cmd_argv_ftype mi_cmd_trace_start; +extern mi_cmd_argv_ftype mi_cmd_trace_status; +extern mi_cmd_argv_ftype mi_cmd_trace_stop; extern mi_cmd_argv_ftype mi_cmd_var_assign; extern mi_cmd_argv_ftype mi_cmd_var_create; extern mi_cmd_argv_ftype mi_cmd_var_delete; diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 4e31c72..c30e0e5 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -51,6 +51,7 @@ #include "inferior.h" #include "osdata.h" #include "splay-tree.h" +#include "tracepoint.h" #include #include @@ -2077,3 +2078,22 @@ print_diff (struct mi_timestamp *start, struct mi_timestamp *end) timeval_diff (start->utime, end->utime) / 1000000.0, timeval_diff (start->stime, end->stime) / 1000000.0); } + +void +mi_cmd_trace_start (char *command, char **argv, int argc) +{ + start_tracing (); +} + +void +mi_cmd_trace_status (char *command, char **argv, int argc) +{ + trace_status_mi (0); +} + +void +mi_cmd_trace_stop (char *command, char **argv, int argc) +{ + stop_tracing (); + trace_status_mi (1); +} -- cgit v1.1