diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2010-03-23 22:05:46 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2010-03-23 22:05:46 +0000 |
commit | 011aacb08ecf70c5d4ad1d6976c32a734846ef79 (patch) | |
tree | ed17fd708b23c3ae519cdc67a69d902f4e5277c6 /gdb/mi | |
parent | f197e0f1b1c70895aae1395b96d780379ec695ab (diff) | |
download | gdb-011aacb08ecf70c5d4ad1d6976c32a734846ef79.zip gdb-011aacb08ecf70c5d4ad1d6976c32a734846ef79.tar.gz gdb-011aacb08ecf70c5d4ad1d6976c32a734846ef79.tar.bz2 |
Implement -trace-save.
* mi-cmds.h (mi_cmds_trace_save): Declare.
* mi-cmds.c (mi_cmds): Register -trace-save.
* mi/mi-main.c (mi_cmd_trace_save): New.
* remote.c (remote_save_trace_data): Take const parameter.
* target.h (struct target_ops::to_save_trace_data): Take
const parameter.
* target.c (update_current_target): Adjust to the above.
* tracepoint.c (trave_save): New, extracted from
(trace_save_command): ...this.
(tfile_trace_find): Remove message that is unnecessary now
that 'tfind' reports found frame.
* tracepoint.h (trace_save): Declare.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-cmds.c | 1 | ||||
-rw-r--r-- | gdb/mi/mi-cmds.h | 1 | ||||
-rw-r--r-- | gdb/mi/mi-main.c | 26 |
3 files changed, 28 insertions, 0 deletions
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index f430698..92311e8 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -109,6 +109,7 @@ struct mi_cmd mi_cmds[] = { "trace-define-variable", { NULL, 0 }, mi_cmd_trace_define_variable }, { "trace-find", { NULL, 0 }, mi_cmd_trace_find }, { "trace-list-variables", { NULL, 0 }, mi_cmd_trace_list_variables }, + { "trace-save", { NULL, 0 }, mi_cmd_trace_save }, { "trace-start", { NULL, 0 }, mi_cmd_trace_start }, { "trace-status", { NULL, 0 }, mi_cmd_trace_status }, { "trace-stop", { NULL, 0 }, mi_cmd_trace_stop }, diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 32e0ec4..5954aef 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -92,6 +92,7 @@ extern mi_cmd_argv_ftype mi_cmd_thread_select; extern mi_cmd_argv_ftype mi_cmd_trace_define_variable; extern mi_cmd_argv_ftype mi_cmd_trace_find; extern mi_cmd_argv_ftype mi_cmd_trace_list_variables; +extern mi_cmd_argv_ftype mi_cmd_trace_save; 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; diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index b016436..340ac68 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -2211,6 +2211,32 @@ mi_cmd_trace_find (char *command, char **argv, int argc) } void +mi_cmd_trace_save (char *command, char **argv, int argc) +{ + int target_saves = 0; + char *filename; + + if (argc != 1 && argc != 2) + error (_("Usage: -trace-save [-r] filename")); + + if (argc == 2) + { + filename = argv[1]; + if (strcmp (argv[0], "-r") == 0) + target_saves = 1; + else + error (_("Invalid option: %s"), argv[0]); + } + else + { + filename = argv[0]; + } + + trace_save (filename, target_saves); +} + + +void mi_cmd_trace_start (char *command, char **argv, int argc) { start_tracing (); |