diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-03-16 02:57:42 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-03-16 02:57:42 +0000 |
commit | 54f7a7244e39168648702c3b69c048c03d13820c (patch) | |
tree | ea927fb48f9e4718602d5240128215f78547c94d | |
parent | 7c369a0aadcb520073c1a7611b52c808f9e152a6 (diff) | |
download | gdb-54f7a7244e39168648702c3b69c048c03d13820c.tar.gz |
* 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.
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/eval.c | 3 | ||||
-rw-r--r-- | gdb/findvar.c | 14 | ||||
-rw-r--r-- | gdb/value.h | 3 |
4 files changed, 18 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 46d61270986..56e04342c0e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +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. diff --git a/gdb/eval.c b/gdb/eval.c index 3f5aca3733c..0b42a584cf8 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -447,8 +447,7 @@ evaluate_subexp_standard (struct type *expect_type, 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)); diff --git a/gdb/findvar.c b/gdb/findvar.c index 3a160a3597b..5d54117d890 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -283,15 +283,15 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr) -/* 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; @@ -300,7 +300,7 @@ value_of_register (int regnum) 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 */ diff --git a/gdb/value.h b/gdb/value.h index d6fa9ff9c1f..29a178fe88f 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -317,7 +317,8 @@ extern struct value *value_from_register (struct type *type, int regnum, 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 *); |