aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.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/valops.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/valops.c')
-rw-r--r--gdb/valops.c6
1 files changed, 5 insertions, 1 deletions
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);
}