aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>2010-04-09 19:34:57 +0000
committerStan Shebs <shebs@codesourcery.com>2010-04-09 19:34:57 +0000
commit2114d44c8d510ec65122253b3c0d0ef15821583a (patch)
tree075a9e8c4560df7896f62f20ccfbe374ea006ca3 /gdb/tracepoint.c
parent721ea635afd84626c185cd4b1f4a2a28c97fbf3a (diff)
downloadgdb-2114d44c8d510ec65122253b3c0d0ef15821583a.zip
gdb-2114d44c8d510ec65122253b3c0d0ef15821583a.tar.gz
gdb-2114d44c8d510ec65122253b3c0d0ef15821583a.tar.bz2
2010-04-09 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_dump_command): Include default-collect expressions.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 570ea5d..f5fa8c8 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2481,6 +2481,9 @@ trace_dump_command (char *args, int from_tty)
struct breakpoint *t;
int stepping_frame = 0;
struct bp_location *loc;
+ char *line, *default_collect_line = NULL;
+ struct command_line *actions, *default_collect_action = NULL;
+ struct cleanup *old_chain = NULL;
if (tracepoint_number == -1)
{
@@ -2512,7 +2515,29 @@ trace_dump_command (char *args, int from_tty)
if (loc->address == regcache_read_pc (regcache))
stepping_frame = 0;
- trace_dump_actions (breakpoint_commands (t), 0, stepping_frame, from_tty);
+ actions = breakpoint_commands (t);
+
+ /* If there is a default-collect list, make up a collect command,
+ prepend to the tracepoint's commands, and pass the whole mess to
+ the trace dump scanner. We need to validate because
+ default-collect might have been junked since the trace run. */
+ if (*default_collect)
+ {
+ default_collect_line = xstrprintf ("collect %s", default_collect);
+ old_chain = make_cleanup (xfree, default_collect_line);
+ line = default_collect_line;
+ validate_actionline (&line, t);
+ default_collect_action = xmalloc (sizeof (struct command_line));
+ make_cleanup (xfree, default_collect_action);
+ default_collect_action->next = actions;
+ default_collect_action->line = line;
+ actions = default_collect_action;
+ }
+
+ trace_dump_actions (actions, 0, stepping_frame, from_tty);
+
+ if (*default_collect)
+ do_cleanups (old_chain);
}
/* Encode a piece of a tracepoint's source-level definition in a form