* amd64-sol2-tdep.c (amd64_sol2_gregset_reg_offset): Correct
[deliverable/binutils-gdb.git] / gdb / value.h
index 3bcd839e237667bb050a578331f4ab68706c260d..2a2274d83cfaa13c65c047d147466f8fd9d3bbec 100644 (file)
@@ -1,8 +1,6 @@
 /* Definitions for values of C expressions, for GDB.
 
-   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-   2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1986-2012 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -156,13 +154,15 @@ struct lval_funcs
 {
   /* Fill in VALUE's contents.  This is used to "un-lazy" values.  If
      a problem arises in obtaining VALUE's bits, this function should
-     call 'error'.  */
+     call 'error'.  If it is NULL value_fetch_lazy on "un-lazy"
+     non-optimized-out value is an internal error.  */
   void (*read) (struct value *v);
 
   /* Handle an assignment TOVAL = FROMVAL by writing the value of
      FROMVAL to TOVAL's location.  The contents of TOVAL have not yet
      been updated.  If a problem arises in doing so, this function
-     should call 'error'.  */
+     should call 'error'.  If it is NULL such TOVAL assignment is an error as
+     TOVAL is not considered as an lvalue.  */
   void (*write) (struct value *toval, struct value *fromval);
 
   /* Check the validity of some bits in VALUE.  This should return 1
@@ -178,6 +178,11 @@ struct lval_funcs
      will fall back to ordinary indirection.  */
   struct value *(*indirect) (struct value *value);
 
+  /* If non-NULL, this is used to implement reference resolving for
+     this value.  This method may return NULL, in which case coerce_ref
+     will fall back to ordinary references resolving.  */
+  struct value *(*coerce_ref) (const struct value *value);
+
   /* If non-NULL, this is used to determine whether the indicated bits
      of VALUE are a synthetic pointer.  */
   int (*check_synthetic_pointer) (const struct value *value,
@@ -211,7 +216,7 @@ extern struct value *allocate_optimized_out_value (struct type *type);
 
 /* If VALUE is lval_computed, return its lval_funcs structure.  */
 
-extern const struct lval_funcs *value_computed_funcs (struct value *value);
+extern const struct lval_funcs *value_computed_funcs (const struct value *);
 
 /* If VALUE is lval_computed, return its closure.  The meaning of the
    returned value depends on the functions VALUE uses.  */
@@ -312,6 +317,9 @@ extern void set_value_component_location (struct value *component,
 extern enum lval_type *deprecated_value_lval_hack (struct value *);
 #define VALUE_LVAL(val) (*deprecated_value_lval_hack (val))
 
+/* Like VALUE_LVAL, except the parameter can be const.  */
+extern enum lval_type value_lval_const (const struct value *value);
+
 /* If lval == lval_memory, return the address in the inferior.  If
    lval == lval_register, return the byte offset into the registers
    structure.  Otherwise, return 0.  The returned address
@@ -338,6 +346,11 @@ extern struct frame_id *deprecated_value_frame_id_hack (struct value *);
 extern short *deprecated_value_regnum_hack (struct value *);
 #define VALUE_REGNUM(val) (*deprecated_value_regnum_hack (val))
 
+/* Return value after lval_funcs->coerce_ref (after check_typedef).  Return
+   NULL if lval_funcs->coerce_ref is not applicable for whatever reason.  */
+
+extern struct value *coerce_ref_if_computed (const struct value *arg);
+
 /* Convert a REF to the object referenced.  */
 
 extern struct value *coerce_ref (struct value *value);
@@ -487,13 +500,17 @@ extern struct value *default_value_from_register (struct type *type,
                                                  int regnum,
                                                  struct frame_info *frame);
 
+extern void read_frame_register_value (struct value *value,
+                                      struct frame_info *frame);
+
 extern struct value *value_from_register (struct type *type, int regnum,
                                          struct frame_info *frame);
 
 extern CORE_ADDR address_from_register (struct type *type, int regnum,
                                        struct frame_info *frame);
 
-extern struct value *value_of_variable (struct symbol *var, struct block *b);
+extern struct value *value_of_variable (struct symbol *var,
+                                       const struct block *b);
 
 extern struct value *address_of_variable (struct symbol *var, struct block *b);
 
@@ -584,7 +601,7 @@ extern struct fn_field *value_find_oload_method_list (struct value **,
 
 enum oload_search_type { NON_METHOD, METHOD, BOTH };
 
-extern int find_overload_match (struct type **arg_types, int nargs,
+extern int find_overload_match (struct value **args, int nargs,
                                const char *name,
                                enum oload_search_type method, int lax,
                                struct value **objp, struct symbol *fsym,
@@ -615,7 +632,7 @@ extern struct value *value_dynamic_cast (struct type *type, struct value *arg);
 
 extern struct value *value_zero (struct type *type, enum lval_type lv);
 
-extern struct value *value_one (struct type *type, enum lval_type lv);
+extern struct value *value_one (struct type *type);
 
 extern struct value *value_repeat (struct value *arg1, int count);
 
@@ -717,8 +734,9 @@ extern int value_logical_not (struct value *arg1);
 
 /* C++ */
 
-extern struct value *value_of_this (const struct language_defn *lang,
-                                   int complain);
+extern struct value *value_of_this (const struct language_defn *lang);
+
+extern struct value *value_of_this_silent (const struct language_defn *lang);
 
 extern struct value *value_x_binop (struct value *arg1, struct value *arg2,
                                    enum exp_opcode op,
@@ -752,12 +770,14 @@ extern void free_value_chain (struct value *v);
 
 extern void release_value (struct value *val);
 
+extern void release_value_or_incref (struct value *val);
+
 extern int record_latest_value (struct value *val);
 
 extern void modify_field (struct type *type, gdb_byte *addr,
                          LONGEST fieldval, int bitpos, int bitsize);
 
-extern void type_print (struct type *type, char *varstring,
+extern void type_print (struct type *type, const char *varstring,
                        struct ui_file *stream, int show);
 
 extern char *type_to_string (struct type *type);
This page took 0.026045 seconds and 4 git commands to generate.