/* Pointer to internal variable. */
struct internalvar *internalvar;
-
- /* Number of register. Only used with lval_reg_frame_relative. */
- int regnum;
} location;
/* Describes offset of a value within lval of a structure in bytes.
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. */
struct value *next;
/* Register number if the value is from a register. */
- short regno;
+ short regnum;
/* If zero, contents of this value are in the contents field. If
nonzero, contents are in inferior memory at address in the
actually exist in the program. */
char optimized_out;
- /* The BFD section associated with this value. */
- asection *bfd_section;
-
/* Actual contents of the value. For use of this value; setting
it uses the stuff above. Not valid if lazy is nonzero.
Target byte-order. We force it to be aligned properly for any
/* Do not add any new members here -- contents above will trash them. */
};
-#define VALUE_TYPE(val) (val)->type
+
+extern struct type *value_type (struct value *);
+extern int value_bitsize (struct value *);
+extern int value_bitpos (struct value *);
+extern int value_offset (struct value *);
+
#define VALUE_ENCLOSING_TYPE(val) (val)->enclosing_type
#define VALUE_LAZY(val) (val)->lazy
#define VALUE_LVAL(val) (val)->lval
#define VALUE_ADDRESS(val) (val)->location.address
#define VALUE_INTERNALVAR(val) (val)->location.internalvar
-#define VALUE_FRAME_REGNUM(val) ((val)->location.regnum)
#define VALUE_FRAME_ID(val) ((val)->frame_id)
-#define VALUE_OFFSET(val) (val)->offset
-#define VALUE_BITSIZE(val) (val)->bitsize
-#define VALUE_BITPOS(val) (val)->bitpos
-#define VALUE_NEXT(val) (val)->next
-#define VALUE_REGNO(val) (val)->regno
+#define VALUE_REGNUM(val) (val)->regnum
#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
#define VALUE_EMBEDDED_OFFSET(val) ((val)->embedded_offset)
#define VALUE_POINTED_TO_OFFSET(val) ((val)->pointed_to_offset)
-#define VALUE_BFD_SECTION(val) ((val)->bfd_section)
/* Convert a REF to the object referenced. */
-#define COERCE_REF(arg) \
- do { \
- struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg)); \
- if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \
- arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \
- unpack_pointer (VALUE_TYPE (arg), \
- VALUE_CONTENTS (arg)), \
- VALUE_BFD_SECTION (arg)); \
- } while (0)
+extern struct value *coerce_ref (struct value *value);
/* If ARG is an array, convert it to a pointer.
If ARG is an enum, convert it to an integer.
References are dereferenced. */
-#define COERCE_ARRAY(arg) \
- do { \
- COERCE_REF(arg); \
- if (current_language->c_style_arrays \
- && TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY) \
- arg = value_coerce_array (arg); \
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FUNC) \
- arg = value_coerce_function (arg); \
- } while (0)
-
-#define COERCE_NUMBER(arg) \
- do { COERCE_ARRAY(arg); COERCE_ENUM(arg); } while (0)
-
-/* NOTE: cagney/2002-12-17: This macro was handling a chill language
- problem but that language has gone away. */
-#define COERCE_VARYING_ARRAY(arg, real_arg_type)
+extern struct value *coerce_array (struct value *value);
+extern struct value *coerce_number (struct value *value);
/* If ARG is an enum, convert it to an integer. */
-#define COERCE_ENUM(arg) \
- do { \
- if (TYPE_CODE (check_typedef (VALUE_TYPE (arg))) == TYPE_CODE_ENUM) \
- arg = value_cast (builtin_type_unsigned_int, arg); \
- } while (0)
+extern struct value *coerce_enum (struct value *value);
/* Internal variables (variables for convenience of use of debugger)
are recorded as a chain of these structures. */
extern struct value *value_from_double (struct type *type, DOUBLEST num);
extern struct value *value_from_string (char *string);
-extern struct value *value_at (struct type *type, CORE_ADDR addr,
- asection * sect);
-extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr,
- asection * sect);
+extern struct value *value_at (struct type *type, CORE_ADDR addr);
+extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
extern struct value *value_from_register (struct type *type, int regnum,
struct frame_info *frame);
extern int using_struct_return (struct type *value_type, int gcc_p);
-extern void set_return_value (struct value *val);
-
extern struct value *evaluate_expression (struct expression *exp);
extern struct value *evaluate_type (struct expression *exp);
extern struct value *value_allocate_space_in_inferior (int);
-extern CORE_ADDR legacy_push_arguments (int nargs, struct value ** args,
- CORE_ADDR sp, int struct_return,
- CORE_ADDR struct_addr);
-
extern struct value *value_of_local (const char *name, int complain);
#endif /* !defined (VALUE_H) */