mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-18 14:04:24 +08:00
2005-02-07 Andrew Cagney <cagney@gnu.org>
* value.h (deprecated_set_value_modifiable) (deprecated_value_modifiable): Declare. * value.c (deprecated_set_value_modifiable): Define. (deprecated_value_modifiable): Define. * ada-lang.c, valops.c, breakpoint.c, tracepoint.c: Update.
This commit is contained in:
parent
8082c5a8f1
commit
88e3b34b7c
@ -1,5 +1,11 @@
|
|||||||
2005-02-07 Andrew Cagney <cagney@gnu.org>
|
2005-02-07 Andrew Cagney <cagney@gnu.org>
|
||||||
|
|
||||||
|
* value.h (deprecated_set_value_modifiable)
|
||||||
|
(deprecated_value_modifiable): Declare.
|
||||||
|
* value.c (deprecated_set_value_modifiable): Define.
|
||||||
|
(deprecated_value_modifiable): Define.
|
||||||
|
* ada-lang.c, valops.c, breakpoint.c, tracepoint.c: Update.
|
||||||
|
|
||||||
* value.h (deprecated_set_value_type): Declare.
|
* value.h (deprecated_set_value_type): Declare.
|
||||||
* value.c (deprecated_set_value_type): Define.
|
* value.c (deprecated_set_value_type): Define.
|
||||||
* hpacc-abi.c, gnu-v2-abi.c, cp-valprint.c: Update.
|
* hpacc-abi.c, gnu-v2-abi.c, cp-valprint.c: Update.
|
||||||
|
@ -2008,7 +2008,7 @@ ada_value_assign (struct value *toval, struct value *fromval)
|
|||||||
struct type *type = value_type (toval);
|
struct type *type = value_type (toval);
|
||||||
int bits = value_bitsize (toval);
|
int bits = value_bitsize (toval);
|
||||||
|
|
||||||
if (!toval->modifiable)
|
if (!deprecated_value_modifiable (toval))
|
||||||
error (_("Left operand of assignment is not a modifiable lvalue."));
|
error (_("Left operand of assignment is not a modifiable lvalue."));
|
||||||
|
|
||||||
toval = coerce_ref (toval);
|
toval = coerce_ref (toval);
|
||||||
|
@ -5821,7 +5821,7 @@ can_use_hardware_watchpoint (struct value *v)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (v->lval != not_lval && v->modifiable == 0)
|
else if (v->lval != not_lval && deprecated_value_modifiable (v) == 0)
|
||||||
return 0; /* ??? What does this represent? */
|
return 0; /* ??? What does this represent? */
|
||||||
else if (v->lval == lval_register)
|
else if (v->lval == lval_register)
|
||||||
return 0; /* cannot watch a register with a HW watchpoint */
|
return 0; /* cannot watch a register with a HW watchpoint */
|
||||||
|
@ -300,7 +300,7 @@ set_traceframe_context (CORE_ADDR trace_pc)
|
|||||||
memcpy (value_contents_raw (func_val),
|
memcpy (value_contents_raw (func_val),
|
||||||
DEPRECATED_SYMBOL_NAME (traceframe_fun),
|
DEPRECATED_SYMBOL_NAME (traceframe_fun),
|
||||||
len);
|
len);
|
||||||
func_val->modifiable = 0;
|
deprecated_set_value_modifiable (func_val, 0);
|
||||||
set_internalvar (lookup_internalvar ("trace_func"), func_val);
|
set_internalvar (lookup_internalvar ("trace_func"), func_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ set_traceframe_context (CORE_ADDR trace_pc)
|
|||||||
memcpy (value_contents_raw (file_val),
|
memcpy (value_contents_raw (file_val),
|
||||||
traceframe_sal.symtab->filename,
|
traceframe_sal.symtab->filename,
|
||||||
len);
|
len);
|
||||||
file_val->modifiable = 0;
|
deprecated_set_value_modifiable (file_val, 0);
|
||||||
set_internalvar (lookup_internalvar ("trace_file"), file_val);
|
set_internalvar (lookup_internalvar ("trace_file"), file_val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -521,7 +521,7 @@ value_assign (struct value *toval, struct value *fromval)
|
|||||||
struct value *val;
|
struct value *val;
|
||||||
struct frame_id old_frame;
|
struct frame_id old_frame;
|
||||||
|
|
||||||
if (!toval->modifiable)
|
if (!deprecated_value_modifiable (toval))
|
||||||
error ("Left operand of assignment is not a modifiable lvalue.");
|
error ("Left operand of assignment is not a modifiable lvalue.");
|
||||||
|
|
||||||
toval = coerce_ref (toval);
|
toval = coerce_ref (toval);
|
||||||
|
15
gdb/value.c
15
gdb/value.c
@ -21,10 +21,6 @@
|
|||||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
/* Hack so that value.h can detect when it's being included by
|
|
||||||
value.c. */
|
|
||||||
#define VALUE_C
|
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
@ -273,6 +269,17 @@ deprecated_value_regnum_hack (struct value *value)
|
|||||||
{
|
{
|
||||||
return &value->regnum;
|
return &value->regnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
deprecated_value_modifiable (struct value *value)
|
||||||
|
{
|
||||||
|
return value->modifiable;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
deprecated_set_value_modifiable (struct value *value, int modifiable)
|
||||||
|
{
|
||||||
|
value->modifiable = modifiable;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return a mark in the value chain. All values allocated after the
|
/* Return a mark in the value chain. All values allocated after the
|
||||||
mark is obtained (except for those released) are subject to being freed
|
mark is obtained (except for those released) are subject to being freed
|
||||||
|
11
gdb/value.h
11
gdb/value.h
@ -80,11 +80,7 @@ struct value
|
|||||||
struct frame_id frame_id;
|
struct frame_id frame_id;
|
||||||
|
|
||||||
/* Type of the value. */
|
/* Type of the value. */
|
||||||
#ifdef VALUE_C
|
|
||||||
struct type *type;
|
struct type *type;
|
||||||
#else
|
|
||||||
struct type *xtype;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If a value represents a C++ object, then the `type' field gives
|
/* If a value represents a C++ object, then the `type' field gives
|
||||||
the object's compile-time type. If the object actually belongs
|
the object's compile-time type. If the object actually belongs
|
||||||
@ -187,6 +183,13 @@ extern int value_bitsize (struct value *);
|
|||||||
extern int value_bitpos (struct value *);
|
extern int value_bitpos (struct value *);
|
||||||
extern int value_offset (struct value *);
|
extern int value_offset (struct value *);
|
||||||
|
|
||||||
|
/* The comment from "struct value" reads: ``Is it modifiable? Only
|
||||||
|
relevant if lval != not_lval.''. Shouldn't the value instead be
|
||||||
|
not_lval and be done with it? */
|
||||||
|
extern int deprecated_value_modifiable (struct value *value);
|
||||||
|
extern void deprecated_set_value_modifiable (struct value *value,
|
||||||
|
int modifiable);
|
||||||
|
|
||||||
extern struct type *value_enclosing_type (struct value *);
|
extern struct type *value_enclosing_type (struct value *);
|
||||||
extern int value_lazy (struct value *);
|
extern int value_lazy (struct value *);
|
||||||
extern void set_value_lazy (struct value *value, int val);
|
extern void set_value_lazy (struct value *value, int val);
|
||||||
|
Loading…
Reference in New Issue
Block a user