aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-11-13 02:29:48 +0000
committerAndrew Cagney <cagney@redhat.com>2004-11-13 02:29:48 +0000
commit25ae5d16b1e30cc2bc1f2eb5b51553ea6413433c (patch)
tree2b3f23fb4370aa89030b05c7616bb1f0c3add477 /gdb/findvar.c
parentd73188182eee3fb4c87c24ec1139b0b04cf41c1e (diff)
downloadgdb-25ae5d16b1e30cc2bc1f2eb5b51553ea6413433c.zip
gdb-25ae5d16b1e30cc2bc1f2eb5b51553ea6413433c.tar.gz
gdb-25ae5d16b1e30cc2bc1f2eb5b51553ea6413433c.tar.bz2
2004-11-12 Andrew Cagney <cagney@gnu.org>
* defs.h (enum lval_type): Delete lval_reg_frame_relative. * value.h (struct value): Update comment. * valops.c (value_assign): Fold lval_reg_fame_relative into lval_register. * findvar.c (value_from_register, locate_var_value): Ditto.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c38
1 files changed, 8 insertions, 30 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index c4b8532..487d25e 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -634,7 +634,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
is that REGISTER_TO_VALUE populates the entire value
including the location. */
REGISTER_TO_VALUE (frame, regnum, type, VALUE_CONTENTS_RAW (v));
- VALUE_LVAL (v) = lval_reg_frame_relative;
+ VALUE_LVAL (v) = lval_register;
VALUE_FRAME_ID (v) = get_frame_id (frame);
VALUE_REGNUM (v) = regnum;
}
@@ -678,6 +678,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
{
mem_stor++;
+ /* FIXME: cagney/2004-11-12: I think this is trying to
+ check that the stored registers are adjacent in
+ memory. It isn't doing a good job? */
mem_tracking = (mem_tracking
&& (regnum == local_regnum
|| addr == last_addr));
@@ -685,33 +688,17 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
last_addr = addr;
}
- /* FIXME: cagney/2003-06-04: Shouldn't this always use
- lval_reg_frame_relative? If it doesn't and the register's
- location changes (say after a resume) then this value is
- going to have wrong information. */
- if ((reg_stor && mem_stor)
- || (mem_stor && !mem_tracking))
- /* Mixed storage; all of the hassle we just went through was
- for some good purpose. */
- {
- VALUE_LVAL (v) = lval_reg_frame_relative;
- VALUE_FRAME_ID (v) = get_frame_id (frame);
- VALUE_REGNUM (v) = regnum;
- }
- else if (mem_stor)
+ if (mem_tracking && mem_stor && !reg_stor)
{
VALUE_LVAL (v) = lval_memory;
VALUE_ADDRESS (v) = first_addr;
}
- else if (reg_stor)
+ else
{
VALUE_LVAL (v) = lval_register;
- VALUE_ADDRESS (v) = first_addr;
- VALUE_REGNUM (v) = first_realnum;
+ VALUE_FRAME_ID (v) = get_frame_id (frame);
+ VALUE_REGNUM (v) = regnum;
}
- else
- internal_error (__FILE__, __LINE__,
- "value_from_register: Value not stored anywhere!");
VALUE_OPTIMIZED_OUT (v) = optimized;
@@ -772,15 +759,6 @@ locate_var_value (struct symbol *var, struct frame_info *frame)
REGISTER_NAME (VALUE_REGNUM (lazy_value)));
break;
- case lval_reg_frame_relative:
- gdb_assert (REGISTER_NAME (VALUE_REGNUM (lazy_value)) != NULL
- && *REGISTER_NAME (VALUE_REGNUM (lazy_value)) != '\0');
- error("Address requested for identifier "
- "\"%s\" which is in frame register $%s",
- SYMBOL_PRINT_NAME (var),
- REGISTER_NAME (VALUE_REGNUM (lazy_value)));
- break;
-
default:
error ("Can't take address of \"%s\" which isn't an lvalue.",
SYMBOL_PRINT_NAME (var));