aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-04-03 17:58:58 -0600
committerTom Tromey <tom@tromey.com>2018-04-06 15:44:47 -0600
commit850645cfe82f5854af90ce73f2056712e20fcea2 (patch)
tree0d9a576e15bafdc37e68f6c3ca8e6a928f93e824 /gdb/breakpoint.h
parent22bc8444e6d377fd016253926c2a2597ff944842 (diff)
downloadgdb-850645cfe82f5854af90ce73f2056712e20fcea2.zip
gdb-850645cfe82f5854af90ce73f2056712e20fcea2.tar.gz
gdb-850645cfe82f5854af90ce73f2056712e20fcea2.tar.bz2
Change breakpoints to use value_ref_ptr
Now that value_ref_ptr exists, it is possible to simplify breakpoint and bpstat memory management by using a value_ref_ptr rather than manually handling the reference counts. gdb/ChangeLog 2018-04-06 Tom Tromey <tom@tromey.com> * value.c (release_value): Update. * breakpoint.h (struct watchpoint) <val>: Now a value_ref_ptr. (struct bpstats) <val>: Now a value_ref_ptr. * breakpoint.c (update_watchpoint, breakpoint_init_inferior) (~bpstats, bpstats, bpstat_clear_actions, watchpoint_check) (~watchpoint, print_it_watchpoint, watch_command_1) (invalidate_bp_value_on_memory_change): Update.
Diffstat (limited to 'gdb/breakpoint.h')
-rw-r--r--gdb/breakpoint.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index d8e2b73..062e390 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -31,7 +31,6 @@
#include "common/array-view.h"
#include "cli/cli-script.h"
-struct value;
struct block;
struct gdbpy_breakpoint_object;
struct gdbscm_breakpoint_object;
@@ -813,7 +812,7 @@ struct watchpoint : public breakpoint
/* Value of the watchpoint the last time we checked it, or NULL when
we do not know the value yet or the value was not readable. VAL
is never lazy. */
- struct value *val;
+ value_ref_ptr val;
/* Nonzero if VAL is valid. If VAL_VALID is set but VAL is NULL,
then an error occurred reading the value. */
int val_valid;
@@ -1125,7 +1124,7 @@ struct bpstats
counted_command_line commands;
/* Old value associated with a watchpoint. */
- struct value *old_val;
+ value_ref_ptr old_val;
/* Nonzero if this breakpoint tells us to print the frame. */
char print;