This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Include default-collect expressions in tdump
- From: Stan Shebs <stan at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 08 Apr 2010 16:01:58 -0700
- Subject: [PATCH] Include default-collect expressions in tdump
tdump works by scanning the tracepoint's actions, which means it will
overlook anything acquired via default-collect. This patch fixes that,
by basically mimicking the action prepend that happens on tracepoint
downloads.
Stan
2010-04-08 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (trace_dump_command): Include default-collect
expressions.
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.173
diff -p -r1.173 tracepoint.c
*** tracepoint.c 6 Apr 2010 17:47:40 -0000 1.173
--- tracepoint.c 8 Apr 2010 22:53:35 -0000
*************** trace_dump_command (char *args, int from
*** 2468,2473 ****
--- 2468,2476 ----
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)
{
*************** trace_dump_command (char *args, int from
*** 2499,2505 ****
if (loc->address == regcache_read_pc (regcache))
stepping_frame = 0;
! trace_dump_actions (breakpoint_commands (t), 0, stepping_frame, from_tty);
}
/* Encode a piece of a tracepoint's source-level definition in a form
--- 2502,2530 ----
if (loc->address == regcache_read_pc (regcache))
stepping_frame = 0;
! 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