#if !defined (VALUE_H)
#define VALUE_H 1
#include "doublest.h"
#include "gdb_regex.h"
enum opt_state
{
opt_okay = 0,
opt_away,
opt_evicted,
opt_other
};
#include "frame.h"
struct block;
struct expression;
struct regcache;
struct symbol;
struct type;
struct ui_file;
struct value;
struct cached_value;
void value_clear_inferior_string_pool (void);
struct value *value_next (struct value *);
extern struct type *value_type (struct value *);
extern void deprecated_set_value_type (struct value *value,
struct type *type);
extern int value_bitsize (struct value *);
extern void set_value_bitsize (struct value *, int bit);
extern int value_bitpos (struct value *);
extern void set_value_bitpos (struct value *, int bit);
extern int value_offset (struct value *);
extern void set_value_offset (struct value *, int offset);
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 value *value_change_enclosing_type (struct value *val,
struct type *new_type);
extern int value_pointed_to_offset (struct value *value);
extern void set_value_pointed_to_offset (struct value *value, int val);
extern int value_embedded_offset (struct value *value);
extern void set_value_embedded_offset (struct value *value, int val);
extern int value_lazy (struct value *);
extern void set_value_lazy (struct value *value, int val);
extern gdb_byte *value_contents_raw (struct value *);
extern const gdb_byte *value_contents (struct value *);
extern gdb_byte *value_contents_writeable (struct value *);
extern gdb_byte *value_contents_all_raw (struct value *);
extern const gdb_byte *value_contents_all (struct value *);
extern int value_fetch_lazy (struct value *val);
extern int value_contents_equal (struct value *val1, struct value *val2);
extern enum opt_state value_optimized_out (struct value *value);
extern void set_value_optimized_out (struct value *value, enum opt_state val);
extern enum lval_type *deprecated_value_lval_hack (struct value *);
#define VALUE_LVAL(val) (*deprecated_value_lval_hack (val))
extern CORE_ADDR *deprecated_value_address_hack (struct value *);
#define VALUE_ADDRESS(val) (*deprecated_value_address_hack (val))
extern struct internalvar **deprecated_value_internalvar_hack (struct value *);
#define VALUE_INTERNALVAR(val) (*deprecated_value_internalvar_hack (val))
extern struct frame_id *deprecated_value_frame_id_hack (struct value *);
#define VALUE_FRAME_ID(val) (*deprecated_value_frame_id_hack (val))
extern short *deprecated_value_regnum_hack (struct value *);
#define VALUE_REGNUM(val) (*deprecated_value_regnum_hack (val))
extern struct value *coerce_ref (struct value *value);
extern struct value *coerce_array (struct value *value);
extern struct value *coerce_number (struct value *value);
extern struct value *coerce_enum (struct value *value);
struct internalvar
{
struct internalvar *next;
char *name;
struct value *value;
};
#define METHOD_PTR_IS_VIRTUAL(ADDR) 0
#define METHOD_PTR_FROM_VOFFSET(OFFSET) (0x80000000 + (OFFSET))
#define METHOD_PTR_TO_VOFFSET(ADDR) (~0x80000000 & (ADDR))
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
struct frame_info;
struct fn_field;
extern void print_address_demangle (CORE_ADDR, struct ui_file *, int);
extern LONGEST value_as_long (struct value *val);
extern DOUBLEST value_as_double (struct value *val);
extern CORE_ADDR value_as_address (struct value *val);
extern LONGEST unpack_long (struct type *type, const gdb_byte *valaddr);
extern DOUBLEST unpack_double (struct type *type, const gdb_byte *valaddr,
int *invp);
extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr);
extern LONGEST unpack_field_as_long (struct type *type,
const gdb_byte *valaddr,
int fieldno);
extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num);
extern struct value *value_from_longest (struct type *type, LONGEST num);
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);
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 struct value *value_of_variable (struct symbol *var, struct block *b);
extern struct value *value_of_register (int regnum, struct frame_info *frame);
extern int symbol_read_needs_frame (struct symbol *);
extern struct value *read_var_value (struct symbol *var,
struct frame_info *frame);
extern struct value *locate_var_value (struct symbol *var,
struct frame_info *frame);
extern struct value *allocate_value (struct type *type);
extern struct value *allocate_repeat_value (struct type *type, int count);
extern struct value *value_mark (void);
extern void value_free_to_mark (struct value *mark);
extern struct value *value_string (char *ptr, int len);
extern struct value *value_bitstring (char *ptr, int len);
extern struct value *value_array (int lowbound, int highbound,
struct value **elemvec);
extern struct value *value_concat (struct value *arg1, struct value *arg2);
extern struct value *value_binop (struct value *arg1, struct value *arg2,
enum exp_opcode op);
extern struct value *value_add (struct value *arg1, struct value *arg2);
extern struct value *value_sub (struct value *arg1, struct value *arg2);
extern struct value *value_coerce_array (struct value *arg1);
extern struct value *value_coerce_function (struct value *arg1);
extern struct value *value_ind (struct value *arg1);
extern struct value *value_addr (struct value *arg1);
extern struct value *value_assign (struct value *toval,
struct value *fromval);
extern struct value *value_pos (struct value *arg1);
extern struct value *value_neg (struct value *arg1);
extern struct value *value_complement (struct value *arg1);
extern struct value *value_struct_elt (struct value **argp,
struct value **args,
char *name, int *static_memfuncp,
char *err);
extern struct value *value_aggregate_elt (struct type *curtype,
char *name, enum noside noside);
extern struct value *value_static_field (struct type *type, int fieldno);
extern struct fn_field *value_find_oload_method_list (struct value **, char *,
int, int *,
struct type **, int *);
extern int find_overload_match (struct type **arg_types, int nargs,
char *name, int method, int lax,
struct value **objp, struct symbol *fsym,
struct value **valp, struct symbol **symp,
int *staticp);
extern struct value *value_field (struct value *arg1, int fieldno);
extern struct value *value_primitive_field (struct value *arg1, int offset,
int fieldno,
struct type *arg_type);
extern struct type *value_rtti_target_type (struct value *, int *, int *,
int *);
extern struct value *value_full_object (struct value *, struct type *, int,
int, int);
extern struct value *value_cast (struct type *type, struct value *arg2);
extern struct value *value_zero (struct type *type, enum lval_type lv);
extern struct value *value_repeat (struct value *arg1, int count);
extern struct value *value_subscript (struct value *array, struct value *idx);
extern struct value *register_value_being_returned (struct type *valtype,
struct regcache *retbuf);
extern struct value *value_in (struct value *element, struct value *set);
extern int value_bit_index (struct type *type, const gdb_byte *addr,
int index);
extern int using_struct_return (struct type *value_type, int gcc_p);
extern struct value *evaluate_expression (struct expression *exp);
extern struct value *evaluate_type (struct expression *exp);
extern struct value *evaluate_subexp_with_coercion (struct expression *,
int *, enum noside);
extern struct value *parse_and_eval (char *exp);
extern struct value *parse_to_comma_and_eval (char **expp);
extern struct type *parse_and_eval_type (char *p, int length);
extern CORE_ADDR parse_and_eval_address (char *exp);
extern CORE_ADDR parse_and_eval_address_1 (char **expptr);
extern LONGEST parse_and_eval_long (char *exp);
extern struct value *access_value_history (int num);
extern struct value *value_of_internalvar (struct internalvar *var);
extern void set_internalvar (struct internalvar *var, struct value *val);
extern void set_internalvar_component (struct internalvar *var,
int offset,
int bitpos, int bitsize,
struct value *newvalue);
extern struct internalvar *lookup_internalvar (char *name);
extern int value_equal (struct value *arg1, struct value *arg2);
extern int value_less (struct value *arg1, struct value *arg2);
extern int value_logical_not (struct value *arg1);
extern struct value *value_of_this (int complain);
extern struct value *value_x_binop (struct value *arg1, struct value *arg2,
enum exp_opcode op,
enum exp_opcode otherop,
enum noside noside);
extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op,
enum noside noside);
extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f,
int j, struct type *type, int offset);
extern int binop_user_defined_p (enum exp_opcode op, struct value *arg1,
struct value *arg2);
extern int unop_user_defined_p (enum exp_opcode op, struct value *arg1);
extern int destructor_name_p (const char *name, const struct type *type);
#define value_free(val) xfree (val)
extern void free_all_values (void);
extern void release_value (struct value *val);
extern int record_latest_value (struct value *val);
extern void modify_field (gdb_byte *addr, LONGEST fieldval, int bitpos,
int bitsize);
extern void type_print (struct type *type, char *varstring,
struct ui_file *stream, int show);
extern char *type_sprint (struct type *type, char *varstring, int show);
extern gdb_byte *baseclass_addr (struct type *type, int index,
gdb_byte *valaddr,
struct value **valuep, int *errp);
extern void print_longest (struct ui_file *stream, int format,
int use_local, LONGEST val);
extern void print_floating (const gdb_byte *valaddr, struct type *type,
struct ui_file *stream);
extern int value_print (struct value *val, struct ui_file *stream, int format,
enum val_prettyprint pretty);
extern void value_print_array_elements (struct value *val,
struct ui_file *stream, int format,
enum val_prettyprint pretty);
extern struct value *value_release_to_mark (struct value *mark);
extern int val_print (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
struct ui_file *stream, int format,
int deref_ref, int recurse,
enum val_prettyprint pretty);
extern int common_val_print (struct value *val,
struct ui_file *stream, int format,
int deref_ref, int recurse,
enum val_prettyprint pretty);
extern int val_print_string (CORE_ADDR addr, int len, int width,
struct ui_file *stream);
extern void print_variable_value (struct symbol *var,
struct frame_info *frame,
struct ui_file *stream);
extern void
print_variable_value (struct symbol *var, struct frame_info *frame,
struct ui_file *stream);
extern int check_field (struct value *, const char *);
extern void typedef_print (struct type *type, struct symbol *news,
struct ui_file *stream);
extern char *internalvar_name (struct internalvar *var);
extern void clear_value_history (void);
extern void clear_internalvars (void);
extern struct value *value_copy (struct value *);
extern struct value *varying_to_slice (struct value *);
extern struct value *value_slice (struct value *, int, int);
extern struct value *call_function_by_hand (struct value *, int,
struct value **);
extern struct value *
call_function_by_hand_expecting_type (struct value *,
struct type *, int,
struct value **, int);
extern struct value *value_literal_complex (struct value *, struct value *,
struct type *);
extern void find_rt_vbase_offset (struct type *, struct type *,
const gdb_byte *, int, int *, int *);
extern CORE_ADDR find_function_addr (struct value *, struct type **);
extern struct value *find_function_in_inferior (const char *, struct type *);
extern struct value *value_allocate_space_in_inferior (int);
extern CORE_ADDR allocate_space_in_inferior_malloc (int);
extern CORE_ADDR default_push_arguments (int nargs, struct value ** args,
CORE_ADDR sp, int struct_return,
CORE_ADDR struct_addr);
extern CORE_ADDR legacy_push_arguments (int nargs, struct value ** args,
CORE_ADDR sp, int struct_return,
CORE_ADDR struct_addr);
struct cached_value * create_cached_function (const char *, struct type *);
extern struct value *lookup_cached_function (struct cached_value *cval);
extern struct value *value_of_local (const char *name, int complain);
extern void set_var_status (struct value *, int);
extern int value_var_status (struct value *);
enum check_which_threads
{
CHECK_CURRENT_THREAD,
CHECK_SCHEDULER_VALUE,
CHECK_ALL_THREADS
};
extern int check_safe_call (regex_t unsafe[],
int npatterns,
int stack_depth,
enum check_which_threads which_thread);
int set_unwind_on_signal (int new_val);
void set_unwind_on_signal_cleanup (void *new_val);
#endif