aboutsummaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-03-01 02:20:39 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-03-01 02:20:39 +0000
commit30974778c12e8c276c54d7b84471fa2c3c1cd9e3 (patch)
tree99247aea561fb348c0d1d928495608ddd3cc2b91 /gdb/values.c
parent2fa73738cf209d54339b057f5e0fcdd879ba2ba4 (diff)
downloadgdb-30974778c12e8c276c54d7b84471fa2c3c1cd9e3.zip
gdb-30974778c12e8c276c54d7b84471fa2c3c1cd9e3.tar.gz
gdb-30974778c12e8c276c54d7b84471fa2c3c1cd9e3.tar.bz2
* value.h (struct value): Add modifiable field.
* values.c (allocate_value, record_latest_value, value_copy): Set it. (record_latest_value): Don't mess with VALUE_LVAL of value. * valops.c (value_assign): Check it. Reword existing error message on not_lval.
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/values.c b/gdb/values.c
index 451cf51..34ea2d1 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -91,6 +91,7 @@ allocate_value (type)
VALUE_REGNO (val) = -1;
VALUE_LAZY (val) = 0;
VALUE_OPTIMIZED_OUT (val) = 0;
+ val->modifiable = 1;
return val;
}
@@ -210,6 +211,7 @@ value_copy (arg)
VALUE_BITSIZE (val) = VALUE_BITSIZE (arg);
VALUE_REGNO (val) = VALUE_REGNO (arg);
VALUE_LAZY (val) = VALUE_LAZY (arg);
+ val->modifiable = arg->modifiable;
if (!VALUE_LAZY (val))
{
memcpy (VALUE_CONTENTS_RAW (val), VALUE_CONTENTS_RAW (arg),
@@ -262,7 +264,10 @@ record_latest_value (val)
a value on the value history never changes. */
if (VALUE_LAZY (val))
value_fetch_lazy (val);
- VALUE_LVAL (val) = not_lval;
+ /* We preserve VALUE_LVAL so that the user can find out where it was fetched
+ from. This is a bit dubious, because then *&$1 does not just return $1
+ but the current contents of that location. c'est la vie... */
+ val->modifiable = 0;
release_value (val);
/* Now we regard value_history_count as origin-one