This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] wrap value->modifiable [ = ... ]
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 07 Feb 2005 19:29:02 -0500
- Subject: [commit] wrap value->modifiable [ = ... ]
This one never had a macro :-/ Going forward it's two possible futures:
- it needs to be moved to value .content .piece.
That would make it per-piece which in turn means that the current
references are no longer valid.
- it's redundant, the information can be encoded in .lval
That makes it dead.
deprecated,
Andrew
2005-02-07 Andrew Cagney <cagney@gnu.org>
* value.h (deprecated_set_value_modifiable)
(deprecated_value_modifiable): Declare.
* value.c (deprecated_set_value_modifiable): Define.
(deprecated_value_modifiable): Define.
* ada-lang.c, valops.c, breakpoint.c, tracepoint.c: Update.
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.73
diff -p -u -r1.73 ada-lang.c
--- ada-lang.c 7 Feb 2005 23:51:02 -0000 1.73
+++ ada-lang.c 8 Feb 2005 00:22:46 -0000
@@ -2008,7 +2008,7 @@ ada_value_assign (struct value *toval, s
struct type *type = value_type (toval);
int bits = value_bitsize (toval);
- if (!toval->modifiable)
+ if (!deprecated_value_modifiable (toval))
error (_("Left operand of assignment is not a modifiable lvalue."));
toval = coerce_ref (toval);
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.198
diff -p -u -r1.198 breakpoint.c
--- breakpoint.c 7 Feb 2005 00:09:53 -0000 1.198
+++ breakpoint.c 8 Feb 2005 00:22:47 -0000
@@ -5821,7 +5821,7 @@ can_use_hardware_watchpoint (struct valu
}
}
}
- else if (v->lval != not_lval && v->modifiable == 0)
+ else if (v->lval != not_lval && deprecated_value_modifiable (v) == 0)
return 0; /* ??? What does this represent? */
else if (v->lval == lval_register)
return 0; /* cannot watch a register with a HW watchpoint */
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.69
diff -p -u -r1.69 tracepoint.c
--- tracepoint.c 7 Feb 2005 23:51:03 -0000 1.69
+++ tracepoint.c 8 Feb 2005 00:22:47 -0000
@@ -300,7 +300,7 @@ set_traceframe_context (CORE_ADDR trace_
memcpy (value_contents_raw (func_val),
DEPRECATED_SYMBOL_NAME (traceframe_fun),
len);
- func_val->modifiable = 0;
+ deprecated_set_value_modifiable (func_val, 0);
set_internalvar (lookup_internalvar ("trace_func"), func_val);
}
@@ -322,7 +322,7 @@ set_traceframe_context (CORE_ADDR trace_
memcpy (value_contents_raw (file_val),
traceframe_sal.symtab->filename,
len);
- file_val->modifiable = 0;
+ deprecated_set_value_modifiable (file_val, 0);
set_internalvar (lookup_internalvar ("trace_file"), file_val);
}
}
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.149
diff -p -u -r1.149 valops.c
--- valops.c 7 Feb 2005 23:51:03 -0000 1.149
+++ valops.c 8 Feb 2005 00:22:48 -0000
@@ -521,7 +521,7 @@ value_assign (struct value *toval, struc
struct value *val;
struct frame_id old_frame;
- if (!toval->modifiable)
+ if (!deprecated_value_modifiable (toval))
error ("Left operand of assignment is not a modifiable lvalue.");
toval = coerce_ref (toval);
Index: value.c
===================================================================
RCS file: /cvs/src/src/gdb/value.c,v
retrieving revision 1.18
diff -p -u -r1.18 value.c
--- value.c 7 Feb 2005 23:51:03 -0000 1.18
+++ value.c 8 Feb 2005 00:22:48 -0000
@@ -273,6 +269,17 @@ deprecated_value_regnum_hack (struct val
{
return &value->regnum;
}
+
+int
+deprecated_value_modifiable (struct value *value)
+{
+ return value->modifiable;
+}
+void
+deprecated_set_value_modifiable (struct value *value, int modifiable)
+{
+ value->modifiable = modifiable;
+}
/* Return a mark in the value chain. All values allocated after the
mark is obtained (except for those released) are subject to being freed
Index: value.h
===================================================================
RCS file: /cvs/src/src/gdb/value.h,v
retrieving revision 1.76
diff -p -u -r1.76 value.h
--- value.h 7 Feb 2005 23:51:03 -0000 1.76
+++ value.h 8 Feb 2005 00:22:48 -0000
@@ -187,6 +183,13 @@ extern int value_bitsize (struct value *
extern int value_bitpos (struct value *);
extern int value_offset (struct value *);
+/* The comment from "struct value" reads: ``Is it modifiable? Only
+ relevant if lval != not_lval.''. Shouldn't the value instead be
+ not_lval and be done with it? */
+extern int deprecated_value_modifiable (struct value *value);
+extern void deprecated_set_value_modifiable (struct value *value,
+ int modifiable);
+
extern struct type *value_enclosing_type (struct value *);
extern int value_lazy (struct value *);
extern void set_value_lazy (struct value *value, int val);