2005-01-15 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / value.h
index 1ee176a7d4be17fd6cfca34a58bd430521fca28b..716f84bf7283518f6de4bfd1e187bb350b4afdf5 100644 (file)
@@ -58,9 +58,6 @@ struct value
 
     /* 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.
@@ -78,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.  */
@@ -139,7 +133,7 @@ struct 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
@@ -162,9 +156,6 @@ struct value
        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
@@ -181,7 +172,12 @@ struct value
     /* 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
 
@@ -216,29 +212,15 @@ extern int value_fetch_lazy (struct value *val);
 #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.
@@ -246,30 +228,12 @@ extern int value_fetch_lazy (struct value *val);
 
    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.  */
@@ -313,10 +277,8 @@ extern struct value *value_from_pointer (struct type *type, CORE_ADDR addr);
 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);
@@ -425,8 +387,6 @@ extern int value_bit_index (struct type *type, char *addr, int index);
 
 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);
@@ -562,10 +522,6 @@ extern struct value *find_function_in_inferior (const char *);
 
 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) */
This page took 0.025262 seconds and 4 git commands to generate.