aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-03-24 21:12:18 +0000
committerTom Tromey <tromey@redhat.com>2010-03-24 21:12:18 +0000
commit9add0f1b436c28b8a22c2fee1b7b355eb9d0e28c (patch)
tree2e25fa3faee3bc526e3358cb7aa049acd369515c /gdb/breakpoint.h
parent414a389f5cf051cbf7792d1b7fcd78632f133193 (diff)
downloadgdb-9add0f1b436c28b8a22c2fee1b7b355eb9d0e28c.zip
gdb-9add0f1b436c28b8a22c2fee1b7b355eb9d0e28c.tar.gz
gdb-9add0f1b436c28b8a22c2fee1b7b355eb9d0e28c.tar.bz2
* 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.
Diffstat (limited to 'gdb/breakpoint.h')
-rw-r--r--gdb/breakpoint.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 3f194c6..4a1a7ad 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -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;