aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-02-08 01:59:38 +0000
committerAndrew Cagney <cagney@redhat.com>2005-02-08 01:59:38 +0000
commit17cf0ecde3a59551f7792b456e7533687f3ec8d1 (patch)
tree0edb273420c74cc163c79e2810975e970b8c018d
parent88e3b34b7c23b9a1b84abdca190f2ced0e5c4c02 (diff)
downloadfsf-binutils-gdb-17cf0ecde3a59551f7792b456e7533687f3ec8d1.zip
fsf-binutils-gdb-17cf0ecde3a59551f7792b456e7533687f3ec8d1.tar.gz
fsf-binutils-gdb-17cf0ecde3a59551f7792b456e7533687f3ec8d1.tar.bz2
2005-02-07 Andrew Cagney <cagney@gnu.org>
* value.h (value_next): Declare. * value.c (value_next): Define. * breakpoint.c: Update.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/breakpoint.c10
-rw-r--r--gdb/value.c6
-rw-r--r--gdb/value.h5
4 files changed, 20 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9db3091..0b1cc05 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2005-02-07 Andrew Cagney <cagney@gnu.org>
+ * value.h (value_next): Declare.
+ * value.c (value_next): Define.
+ * breakpoint.c: Update.
+
* value.h (deprecated_set_value_modifiable)
(deprecated_value_modifiable): Declare.
* value.c (deprecated_set_value_modifiable): Define.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 645fd03..0a117d2 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -743,7 +743,7 @@ static void free_valchain (struct bp_location *b)
the next time the watchpoint is inserted. */
for (v = b->owner->val_chain; v; v = n)
{
- n = v->next;
+ n = value_next (v);
value_free (v);
}
b->owner->val_chain = NULL;
@@ -938,7 +938,7 @@ insert_bp_location (struct bp_location *bpt,
bpt->inserted = 1;
/* Look at each value on the value chain. */
- for (; v; v = v->next)
+ for (; v; v = value_next (v))
{
/* If it's a memory location, and GDB actually needed
its contents to evaluate the expression, then we
@@ -1470,7 +1470,7 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is)
b->inserted = (is == mark_inserted);
/* Walk down the saved value chain. */
- for (v = b->owner->val_chain; v; v = v->next)
+ for (v = b->owner->val_chain; v; v = value_next (v))
{
/* For each memory reference remove the watchpoint
at that address. */
@@ -2725,7 +2725,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid, int stopped_by_watchpoint)
if (!target_stopped_data_address (&current_target, &addr))
continue;
- for (v = b->val_chain; v; v = v->next)
+ for (v = b->val_chain; v; v = value_next (v))
{
if (VALUE_LVAL (v) == lval_memory
&& ! value_lazy (v))
@@ -5789,7 +5789,7 @@ can_use_hardware_watchpoint (struct value *v)
function calls are special in any way. So this function may not
notice that an expression involving an inferior function call
can't be watched with hardware watchpoints. FIXME. */
- for (; v; v = v->next)
+ for (; v; v = value_next (v))
{
if (VALUE_LVAL (v) == lval_memory)
{
diff --git a/gdb/value.c b/gdb/value.c
index 13585b5..c771359 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -123,6 +123,12 @@ allocate_repeat_value (struct type *type, int count)
/* Accessor methods. */
+struct value *
+value_next (struct value *value)
+{
+ return value->next;
+}
+
struct type *
value_type (struct value *value)
{
diff --git a/gdb/value.h b/gdb/value.h
index 172e3f9..cd1403b 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -173,6 +173,11 @@ struct value
};
+/* Values are stored in a chain, so that they can be deleted easily
+ over calls to the inferior. Values assigned to internal variables
+ or put into the value history are taken off this list. */
+struct value *value_next (struct value *);
+
extern struct type *value_type (struct value *);
/* This is being used to change the type of an existing value, that
code should instead be creating a new value with the changed type