* breakpoint.h (struct counted_command_line): New struct.

(struct breakpoint) <commands>: Change type.
	(struct bpstats) <commands>: Change type.
	<commands_left>: New field.
	* breakpoint.c (alloc_counted_command_line): New function.
	(incref_counted_command_line): Likewise.
	(decref_counted_command_line): Likewise.
	(do_cleanup_counted_command_line): Likewise.
	(make_cleanup_decref_counted_command_line): Likewise.
	(breakpoint_set_commands): Use decref_counted_command_line and
	alloc_counted_command_line.
	(commands_command): Don't error if breakpoint commands are
	executing.
	(commands_from_control_command): Likewise.
	(bpstat_free): Update.
	(bpstat_copy): Likewise.
	(bpstat_clear_actions): Likewise.
	(bpstat_do_actions_1): Likewise.
	(bpstat_stop_status): Likewise.
	(print_one_breakpoint_location): Likewise.
	(delete_breakpoint): Likewise.
	(bpstat_alloc): Initialize new field.
	(tracepoint_save_command): Update.
	* tracepoint.c (encode_actions): Update.
	(trace_dump_command): Update.
This commit is contained in:
Tom Tromey
2010-03-24 21:12:18 +00:00
parent 414a389f5c
commit 9add0f1b43
4 changed files with 132 additions and 40 deletions

View File

@ -1385,7 +1385,7 @@ encode_actions (struct breakpoint *t, struct bp_location *tloc,
gdbarch_virtual_frame_pointer (t->gdbarch,
t->loc->address, &frame_reg, &frame_offset);
actions = t->commands;
actions = t->commands->commands;
/* If there are default expressions to collect, make up a collect
action and prepend to the action list to encode. Note that since
@ -1406,7 +1406,7 @@ encode_actions (struct breakpoint *t, struct bp_location *tloc,
{
default_collect_action = xmalloc (sizeof (struct command_line));
make_cleanup (xfree, default_collect_action);
default_collect_action->next = t->commands;
default_collect_action->next = t->commands->commands;
default_collect_action->line = line;
actions = default_collect_action;
}
@ -2332,7 +2332,7 @@ trace_dump_command (char *args, int from_tty)
if (loc->address == regcache_read_pc (regcache))
stepping_frame = 0;
for (action = t->commands; action; action = action->next)
for (action = t->commands->commands; action; action = action->next)
{
struct cmd_list_element *cmd;