* 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

@ -376,6 +376,17 @@ DEF_VEC_I(int);
typedef struct bp_location *bp_location_p;
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;
};
/* 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
does set it to 0). I implemented it because I thought it would be
@ -414,7 +425,7 @@ struct breakpoint
be continued automatically before really stopping. */
int ignore_count;
/* Chain of command lines to execute when this breakpoint is hit. */
struct command_line *commands;
struct counted_command_line *commands;
/* Stack depth (address of frame). If nonzero, break only if fp
equals this. */
struct frame_id frame_id;
@ -698,8 +709,11 @@ struct bpstats
bpstat next;
/* Breakpoint that we are at. */
const struct bp_location *breakpoint_at;
/* Commands left to be done. */
struct command_line *commands;
/* The associated command list. */
struct counted_command_line *commands;
/* Commands left to be done. This points somewhere in
base_command. */
struct command_line *commands_left;
/* Old value associated with a watchpoint. */
struct value *old_val;