summaryrefslogtreecommitdiff
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
commit606fd5aa6b438120a7fd715604338ab02b46a01c (patch)
tree9e4cb797d46f1fec25f50e47d3b2b2697b7b9b3c
parent9d11a78baa5130afa2a31029df9d1392d661d5b3 (diff)
downloadgdb-606fd5aa6b438120a7fd715604338ab02b46a01c.tar.gz
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.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/defs.h10
-rw-r--r--gdb/findvar.c38
-rw-r--r--gdb/valops.c4
-rw-r--r--gdb/value.h7
5 files changed, 22 insertions, 45 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d056e6600ce..5bb6c6d0732 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2004-11-12 Randolph Chung <tausq@debian.org>
* config/tm/tm-hppa.h (SYMBOLS_CAN_START_WITH_DOLLAR): Remove.
diff --git a/gdb/defs.h b/gdb/defs.h
index 64281e12b25..7a38363663e 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -630,18 +630,14 @@ enum lval_type
{
/* Not an lval. */
not_lval,
- /* In memory. Could be a saved register. */
+ /* In memory. */
lval_memory,
- /* In a register. */
+ /* In a register. Registers are relative to a frame. */
lval_register,
/* In a gdb internal variable. */
lval_internalvar,
/* Part of a gdb internal variable (structure field). */
- lval_internalvar_component,
- /* In a register series in a frame not the current one, which may have been
- partially saved or saved in different places (otherwise would be
- lval_register or lval_memory). */
- lval_reg_frame_relative
+ lval_internalvar_component
};
/* Control types for commands */
diff --git a/gdb/findvar.c b/gdb/findvar.c
index c4b85321a41..487d25eefa5 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));
diff --git a/gdb/valops.c b/gdb/valops.c
index 6fa15778519..40290d4a721 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -596,7 +596,6 @@ value_assign (struct value *toval, struct value *fromval)
}
break;
- case lval_reg_frame_relative:
case lval_register:
{
struct frame_info *frame;
@@ -617,7 +616,7 @@ value_assign (struct value *toval, struct value *fromval)
if (!frame)
error ("Value being assigned to is no longer active.");
- if (VALUE_LVAL (toval) == lval_reg_frame_relative
+ if (VALUE_LVAL (toval) == lval_register
&& CONVERT_REGISTER_P (VALUE_REGNUM (toval), type))
{
/* If TOVAL is a special machine register requiring
@@ -699,7 +698,6 @@ value_assign (struct value *toval, struct value *fromval)
{
case lval_memory:
case lval_register:
- case lval_reg_frame_relative:
reinit_frame_cache ();
diff --git a/gdb/value.h b/gdb/value.h
index 0feddbf105e..716f84bf728 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -75,11 +75,8 @@ struct value
For BITS_BIG_ENDIAN=1 targets, it is the position of the MSB. */
int bitpos;
- /* Frame value is relative to. In practice, this ID is only used if
- the value is stored in several registers in other than the
- current frame, and these registers have not all been saved at the
- same place in memory. This will be described in the lval enum
- above as "lval_reg_frame_relative". */
+ /* Frame register value is relative to. This will be described in
+ the lval enum above as "lval_register". */
struct frame_id frame_id;
/* Type of the value. */