+2002-03-15 Andrew Cagney <ac131313@redhat.com>
+
+ * eval.c (evaluate_subexp_standard): Pass ``selected_frame'' to
+ value_of_register.
+ * findvar.c (value_of_register): Add ``frame'' parameter. Pass to
+ get_saved_register.
+ * value.h (value_of_register): Update.
+
2002-03-14 Richard Henderson <rth@redhat.com>
* configure.in: Detect declaration for canonicalize_file_name.
case OP_REGISTER:
{
int regno = longest_to_int (exp->elts[pc + 1].longconst);
- struct value *val = value_of_register (regno);
-
+ struct value *val = value_of_register (regno, selected_frame);
(*pos) += 2;
if (val == NULL)
error ("Value of register %s not available.", REGISTER_NAME (regno));
-/* Return a `value' with the contents of register REGNUM
- in its virtual format, with the type specified by
- REGISTER_VIRTUAL_TYPE.
+/* Return a `value' with the contents of (virtual or cooked) register
+ REGNUM as found in the specified FRAME. The register's type is
+ determined by REGISTER_VIRTUAL_TYPE.
- NOTE: returns NULL if register value is not available.
- Caller will check return value or die! */
+ NOTE: returns NULL if register value is not available. Caller will
+ check return value or die! */
struct value *
-value_of_register (int regnum)
+value_of_register (int regnum, struct frame_info *frame)
{
CORE_ADDR addr;
int optim;
enum lval_type lval;
get_saved_register (raw_buffer, &optim, &addr,
- selected_frame, regnum, &lval);
+ frame, regnum, &lval);
if (register_cached (regnum) < 0)
return NULL; /* register value not available */
extern struct value *value_of_variable (struct symbol *var, struct block *b);
-extern struct value *value_of_register (int regnum);
+extern struct value *value_of_register (int regnum,
+ struct frame_info *frame);
extern int symbol_read_needs_frame (struct symbol *);