diff options
author | Stan Shebs <shebs@codesourcery.com> | 2010-03-31 17:59:49 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 2010-03-31 17:59:49 +0000 |
commit | 8bf6485c1cee41f31564e1097199ff67a3615ebe (patch) | |
tree | b7579caf3a6e8a889331ba48e7b6bfcb9acc1d29 /gdb/breakpoint.c | |
parent | f3c8116cd2e02ccb2bd1bfc131554027b2efe190 (diff) | |
download | gdb-8bf6485c1cee41f31564e1097199ff67a3615ebe.zip gdb-8bf6485c1cee41f31564e1097199ff67a3615ebe.tar.gz gdb-8bf6485c1cee41f31564e1097199ff67a3615ebe.tar.bz2 |
2010-03-31 Stan Shebs <stan@codesourcery.com>
* breakpoint.c (tracepoint_save_command): Include variables,
conditionals, tracepoint types, and default-collect.
* tracepoint.c (save_trace_state_variables): New function.
* tracepoint.h (save_trace_state_variables): Declare it.
* gdb.trace/save-trace.exp: Test save/restore of default-collect
and tracepoint conditionals.
(gdb_verify_tracepoints): Delete unused return.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 2bded96..dfd93f8 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -10649,17 +10649,29 @@ tracepoint_save_command (char *args, int from_tty) error (_("Unable to open file '%s' for saving tracepoints (%s)"), args, safe_strerror (errno)); make_cleanup_ui_file_delete (fp); - + + save_trace_state_variables (fp); + ALL_TRACEPOINTS (tp) { + if (tp->type == bp_fast_tracepoint) + fprintf_unfiltered (fp, "ftrace"); + else + fprintf_unfiltered (fp, "trace"); + if (tp->addr_string) - fprintf_unfiltered (fp, "trace %s\n", tp->addr_string); + fprintf_unfiltered (fp, " %s", tp->addr_string); else { sprintf_vma (tmp, tp->loc->address); - fprintf_unfiltered (fp, "trace *0x%s\n", tmp); + fprintf_unfiltered (fp, " *0x%s", tmp); } + if (tp->cond_string) + fprintf_unfiltered (fp, " if %s", tp->cond_string); + + fprintf_unfiltered (fp, "\n"); + if (tp->pass_count) fprintf_unfiltered (fp, " passcount %d\n", tp->pass_count); @@ -10682,6 +10694,10 @@ tracepoint_save_command (char *args, int from_tty) fprintf_unfiltered (fp, " end\n"); } } + + if (*default_collect) + fprintf_unfiltered (fp, "set default-collect %s\n", default_collect); + do_cleanups (cleanup); if (from_tty) printf_filtered (_("Tracepoints saved to file '%s'.\n"), args); |