From 0c16dd26a8129f61b7a6fb7d9aca8fa8b21b53a8 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 15 Nov 2004 22:17:59 +0000 Subject: [PATCH] 2004-11-15 Andrew Cagney * findvar.c (value_of_register): Set the frame ID. * value.c (value_primitive_field): Copy the frame ID. * valops.c (value_assign): Simplify lval_register case, there's always a frame. --- gdb/ChangeLog | 7 +++++++ gdb/findvar.c | 1 + gdb/valops.c | 12 ++---------- gdb/value.c | 1 + 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 30fe24a..8fc5cc1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2004-11-15 Andrew Cagney + + * findvar.c (value_of_register): Set the frame ID. + * value.c (value_primitive_field): Copy the frame ID. + * valops.c (value_assign): Simplify lval_register case, there's + always a frame. + 2004-11-14 Daniel Jacobowitz * Makefile.in (mips-linux-tdep.o): Update dependencies. diff --git a/gdb/findvar.c b/gdb/findvar.c index 487d25e..cc7d7a5 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -288,6 +288,7 @@ value_of_register (int regnum, struct frame_info *frame) VALUE_ADDRESS (reg_val) = addr; VALUE_REGNUM (reg_val) = regnum; VALUE_OPTIMIZED_OUT (reg_val) = optim; + VALUE_FRAME_ID (reg_val) = get_frame_id (frame); return reg_val; } diff --git a/gdb/valops.c b/gdb/valops.c index 40290d4..fa63871 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -602,16 +602,8 @@ value_assign (struct value *toval, struct value *fromval) int value_reg; /* Figure out which frame this is in currently. */ - if (VALUE_LVAL (toval) == lval_register) - { - frame = get_current_frame (); - value_reg = VALUE_REGNUM (toval); - } - else - { - frame = frame_find_by_id (VALUE_FRAME_ID (toval)); - value_reg = VALUE_REGNUM (toval); - } + frame = frame_find_by_id (VALUE_FRAME_ID (toval)); + value_reg = VALUE_REGNUM (toval); if (!frame) error ("Value being assigned to is no longer active."); diff --git a/gdb/value.c b/gdb/value.c index 2bbaeac..5afc5b4 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -964,6 +964,7 @@ value_primitive_field (struct value *arg1, int offset, VALUE_LVAL (v) = lval_internalvar_component; VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1); VALUE_REGNUM (v) = VALUE_REGNUM (arg1); + VALUE_FRAME_ID (v) = VALUE_FRAME_ID (arg1); /* VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */ return v; -- 2.7.4