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.
This commit is contained in:
Andrew Cagney 2004-11-13 02:29:48 +00:00
parent d73188182e
commit 25ae5d16b1
5 changed files with 22 additions and 45 deletions

View file

@ -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> 2004-11-12 Randolph Chung <tausq@debian.org>
* config/tm/tm-hppa.h (SYMBOLS_CAN_START_WITH_DOLLAR): Remove. * config/tm/tm-hppa.h (SYMBOLS_CAN_START_WITH_DOLLAR): Remove.

View file

@ -630,18 +630,14 @@ enum lval_type
{ {
/* Not an lval. */ /* Not an lval. */
not_lval, not_lval,
/* In memory. Could be a saved register. */ /* In memory. */
lval_memory, lval_memory,
/* In a register. */ /* In a register. Registers are relative to a frame. */
lval_register, lval_register,
/* In a gdb internal variable. */ /* In a gdb internal variable. */
lval_internalvar, lval_internalvar,
/* Part of a gdb internal variable (structure field). */ /* Part of a gdb internal variable (structure field). */
lval_internalvar_component, 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
}; };
/* Control types for commands */ /* Control types for commands */

View file

@ -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 is that REGISTER_TO_VALUE populates the entire value
including the location. */ including the location. */
REGISTER_TO_VALUE (frame, regnum, type, VALUE_CONTENTS_RAW (v)); 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_FRAME_ID (v) = get_frame_id (frame);
VALUE_REGNUM (v) = regnum; VALUE_REGNUM (v) = regnum;
} }
@ -678,6 +678,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
{ {
mem_stor++; 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 mem_tracking = (mem_tracking
&& (regnum == local_regnum && (regnum == local_regnum
|| addr == last_addr)); || addr == last_addr));
@ -685,33 +688,17 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
last_addr = addr; last_addr = addr;
} }
/* FIXME: cagney/2003-06-04: Shouldn't this always use if (mem_tracking && mem_stor && !reg_stor)
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)
{ {
VALUE_LVAL (v) = lval_memory; VALUE_LVAL (v) = lval_memory;
VALUE_ADDRESS (v) = first_addr; VALUE_ADDRESS (v) = first_addr;
} }
else if (reg_stor) else
{ {
VALUE_LVAL (v) = lval_register; VALUE_LVAL (v) = lval_register;
VALUE_ADDRESS (v) = first_addr; VALUE_FRAME_ID (v) = get_frame_id (frame);
VALUE_REGNUM (v) = first_realnum; VALUE_REGNUM (v) = regnum;
} }
else
internal_error (__FILE__, __LINE__,
"value_from_register: Value not stored anywhere!");
VALUE_OPTIMIZED_OUT (v) = optimized; 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))); REGISTER_NAME (VALUE_REGNUM (lazy_value)));
break; 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: default:
error ("Can't take address of \"%s\" which isn't an lvalue.", error ("Can't take address of \"%s\" which isn't an lvalue.",
SYMBOL_PRINT_NAME (var)); SYMBOL_PRINT_NAME (var));

View file

@ -596,7 +596,6 @@ value_assign (struct value *toval, struct value *fromval)
} }
break; break;
case lval_reg_frame_relative:
case lval_register: case lval_register:
{ {
struct frame_info *frame; struct frame_info *frame;
@ -617,7 +616,7 @@ value_assign (struct value *toval, struct value *fromval)
if (!frame) if (!frame)
error ("Value being assigned to is no longer active."); 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)) && CONVERT_REGISTER_P (VALUE_REGNUM (toval), type))
{ {
/* If TOVAL is a special machine register requiring /* 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_memory:
case lval_register: case lval_register:
case lval_reg_frame_relative:
reinit_frame_cache (); reinit_frame_cache ();

View file

@ -75,11 +75,8 @@ struct value
For BITS_BIG_ENDIAN=1 targets, it is the position of the MSB. */ For BITS_BIG_ENDIAN=1 targets, it is the position of the MSB. */
int bitpos; int bitpos;
/* Frame value is relative to. In practice, this ID is only used if /* Frame register value is relative to. This will be described in
the value is stored in several registers in other than the the lval enum above as "lval_register". */
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". */
struct frame_id frame_id; struct frame_id frame_id;
/* Type of the value. */ /* Type of the value. */