breakpoint.c, and forward declare.
(breakpoint_commands): Declare.
* breakpoint.c (struct counted_command_line): Moved here.
(breakpoint_commands): New.
* tracepoint.c (encode_actions): Use breakpoint_commands.
* remote.c (remote_download_tracepoint): Ditto.
+2010-04-02 Pedro Alves <pedro@codesourcery.com>
+
+ * breakpoint.h (struct counted_command_line): Moved definition to
+ breakpoint.c, and forward declare.
+ (breakpoint_commands): Declare.
+ * breakpoint.c (struct counted_command_line): Moved here.
+ (breakpoint_commands): New.
+ * tracepoint.c (encode_actions): Use breakpoint_commands.
+ * remote.c (remote_download_tracepoint): Ditto.
+
2010-04-01 H.J. Lu <hongjiu.lu@intel.com>
* remote.c (remote_parse_stop_reply): Use hex_string instead
static void trace_pass_command (char *, int);
+/* A reference-counted struct command_line. This lets multiple
+ breakpoints share a single command list. */
+struct counted_command_line
+{
+ /* The reference count. */
+ int refc;
+
+ /* The command list. */
+ struct command_line *commands;
+};
+
+struct command_line *
+breakpoint_commands (struct breakpoint *b)
+{
+ return b->commands ? b->commands->commands : NULL;
+}
/* Flag indicating that a command has proceeded the inferior past the
current breakpoint. */
DEF_VEC_P(bp_location_p);
/* A reference-counted struct command_line. This lets multiple
- breakpoints share a single command list. */
-struct counted_command_line
-{
- /* The reference count. */
- int refc;
-
- /* The command list. */
- struct command_line *commands;
-};
+ breakpoints share a single command list. This is an implementation
+ detail to the breakpoints module. */
+struct counted_command_line;
/* Note that the ->silent field is not currently used by any commands
(though the code is in there if it was to be, and set_raw_breakpoint
extern void breakpoint_auto_delete (bpstat);
+/* Return the chain of command lines to execute when this breakpoint
+ is hit. */
+extern struct command_line *breakpoint_commands (struct breakpoint *b);
+
extern void break_command (char *, int);
extern void hbreak_command_wrapper (char *, int);
warning (_("Target does not support source download."));
}
remote_download_command_source (t->number, loc->address,
- t->commands->commands);
+ breakpoint_commands (t));
}
do_cleanups (old_chain);
gdbarch_virtual_frame_pointer (t->gdbarch,
t->loc->address, &frame_reg, &frame_offset);
- actions = t->commands->commands;
+ actions = breakpoint_commands (t);
/* If there are default expressions to collect, make up a collect
action and prepend to the action list to encode. Note that since
default_collect_action = xmalloc (sizeof (struct command_line));
make_cleanup (xfree, default_collect_action);
- default_collect_action->next = t->commands->commands;
+ default_collect_action->next = actions;
default_collect_action->line = line;
actions = default_collect_action;
}
if (loc->address == regcache_read_pc (regcache))
stepping_frame = 0;
- for (action = t->commands->commands; action; action = action->next)
+ for (action = breakpoint_commands (t); action; action = action->next)
{
struct cmd_list_element *cmd;