This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Replace value->next with function
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 07 Feb 2005 21:01:54 -0500
- Subject: [commit] Replace value->next with function
committed,
Andrew
2005-02-07 Andrew Cagney <cagney@gnu.org>
* value.h (value_next): Declare.
* value.c (value_next): Define.
* breakpoint.c: Update.
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.199
diff -p -u -r1.199 breakpoint.c
--- breakpoint.c 8 Feb 2005 00:25:31 -0000 1.199
+++ breakpoint.c 8 Feb 2005 01:57:41 -0000
@@ -743,7 +743,7 @@ static void free_valchain (struct bp_loc
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->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
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, p
if (!target_stopped_data_address (¤t_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 valu
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)
{
Index: value.c
===================================================================
RCS file: /cvs/src/src/gdb/value.c,v
retrieving revision 1.19
diff -p -u -r1.19 value.c
--- value.c 8 Feb 2005 00:25:31 -0000 1.19
+++ value.c 8 Feb 2005 01:57:41 -0000
@@ -123,6 +123,12 @@ allocate_repeat_value (struct type *type
/* Accessor methods. */
+struct value *
+value_next (struct value *value)
+{
+ return value->next;
+}
+
struct type *
value_type (struct value *value)
{
Index: value.h
===================================================================
RCS file: /cvs/src/src/gdb/value.h,v
retrieving revision 1.77
diff -p -u -r1.77 value.h
--- value.h 8 Feb 2005 00:25:31 -0000 1.77
+++ value.h 8 Feb 2005 01:57:41 -0000
@@ -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