+2001-07-16 Nick Duffek <nsd@redhat.com>
+
+ * findvar.c (read_var_value): Apply value_as_pointer() to
+ addresses retrieved from the target for LOC_BASEREG and
+ LOC_BASEREG_ARG variables.
+
2001-07-16 Orjan Friberg <orjanf@axis.com>
* NEWS: New target CRIS.
case LOC_BASEREG:
case LOC_BASEREG_ARG:
- {
- char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
- NULL);
- addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
- addr += SYMBOL_VALUE (var);
- break;
- }
-
case LOC_THREAD_LOCAL_STATIC:
{
- char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ value_ptr regval;
- get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
- NULL);
- addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
+ regval = value_from_register (lookup_pointer_type (type),
+ SYMBOL_BASEREG (var), frame);
+ if (regval == NULL)
+ error ("Value of base register not available.");
+ addr = value_as_pointer (regval);
addr += SYMBOL_VALUE (var);
break;
}