From 30974778c12e8c276c54d7b84471fa2c3c1cd9e3 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Tue, 1 Mar 1994 02:20:39 +0000 Subject: * 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. --- gdb/valops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/valops.c') diff --git a/gdb/valops.c b/gdb/valops.c index 8a7b8d8..24f2c78 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -289,6 +289,9 @@ value_assign (toval, fromval) char raw_buffer[MAX_REGISTER_RAW_SIZE]; int use_buffer = 0; + if (!toval->modifiable) + error ("Left operand of assignment is not a modifiable lvalue."); + COERCE_ARRAY (fromval); COERCE_REF (toval); @@ -488,7 +491,7 @@ Can't handle bitfield which doesn't fit in a single register."); default: - error ("Left side of = operation is not an lvalue."); + error ("Left operand of assignment is not an lvalue."); } /* Return a value just like TOVAL except with the contents of FROMVAL @@ -1101,6 +1104,7 @@ call_function_by_hand (function, nargs, args) char format[80]; sprintf (format, "at %s", local_hex_format ()); name = alloca (80); + /* FIXME-32x64: assumes funaddr fits in a long. */ sprintf (name, format, (unsigned long) funaddr); } -- cgit v1.1