GDB (xrefs)
Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/valops.c File Reference
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "frame.h"
#include "inferior.h"
#include "gdbcore.h"
#include "target.h"
#include "demangle.h"
#include "language.h"
#include "gdbcmd.h"
#include "regcache.h"
#include "cp-abi.h"
#include "block.h"
#include "infcall.h"
#include "dictionary.h"
#include "cp-support.h"
#include "dfp.h"
#include "tracepoint.h"
#include <errno.h>
#include "gdb_string.h"
#include "gdb_assert.h"
#include "observer.h"
#include "objfiles.h"
#include "exceptions.h"

Go to the source code of this file.

Enumerations

enum  oload_classification { STANDARD, NON_STANDARD, INCOMPATIBLE }

Functions

static int typecmp (int staticp, int varargs, int nargs, struct field t1[], struct value *t2[])
static struct valuesearch_struct_field (const char *, struct value *, int, struct type *, int)
static struct valuesearch_struct_method (const char *, struct value **, struct value **, int, int *, struct type *)
static int find_oload_champ_namespace (struct value **, int, const char *, const char *, struct symbol ***, struct badness_vector **, const int no_adl)
static int find_oload_champ_namespace_loop (struct value **, int, const char *, const char *, int, struct symbol ***, struct badness_vector **, int *, const int no_adl)
static int find_oload_champ (struct value **, int, int, int, struct fn_field *, struct symbol **, struct badness_vector **)
static int oload_method_static (int, struct fn_field *, int)
static enum oload_classification classify_oload_match (struct badness_vector *, int, int)
static struct valuevalue_struct_elt_for_reference (struct type *, int, struct type *, char *, struct type *, int, enum noside)
static struct valuevalue_namespace_elt (const struct type *, char *, int, enum noside)
static struct valuevalue_maybe_namespace_elt (const struct type *, char *, int, enum noside)
static CORE_ADDR allocate_space_in_inferior (int)
static struct valuecast_into_complex (struct type *, struct value *)
static struct fn_field * find_method_list (struct value **, const char *, int, struct type *, int *, struct type **, int *)
void _initialize_valops (void)
static void show_overload_resolution (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct valuefind_function_in_inferior (const char *name, struct objfile **objf_p)
struct valuevalue_allocate_space_in_inferior (int len)
static struct valuevalue_cast_structs (struct type *type, struct value *v2)
struct valuevalue_cast_pointers (struct type *type, struct value *arg2, int subclass_check)
struct valuevalue_cast (struct type *type, struct value *arg2)
struct valuevalue_reinterpret_cast (struct type *type, struct value *arg)
static int dynamic_cast_check_1 (struct type *desired_type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, CORE_ADDR arg_addr, struct type *arg_type, struct value **result)
static int dynamic_cast_check_2 (struct type *desired_type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, struct value **result)
struct valuevalue_dynamic_cast (struct type *type, struct value *arg)
struct valuevalue_zero (struct type *type, enum lval_type lv)
struct valuevalue_one (struct type *type)
static struct valueget_value_at (struct type *type, CORE_ADDR addr, int lazy)
struct valuevalue_at (struct type *type, CORE_ADDR addr)
struct valuevalue_at_lazy (struct type *type, CORE_ADDR addr)
void read_value_memory (struct value *val, int embedded_offset, int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length)
struct valuevalue_assign (struct value *toval, struct value *fromval)
struct valuevalue_repeat (struct value *arg1, int count)
struct valuevalue_of_variable (struct symbol *var, const struct block *b)
struct valueaddress_of_variable (struct symbol *var, const struct block *b)
int value_must_coerce_to_target (struct value *val)
struct valuevalue_coerce_to_target (struct value *val)
struct valuevalue_coerce_array (struct value *arg1)
struct valuevalue_coerce_function (struct value *arg1)
struct valuevalue_addr (struct value *arg1)
struct valuevalue_ref (struct value *arg1)
struct valuevalue_ind (struct value *arg1)
struct valuevalue_array (int lowbound, int highbound, struct value **elemvec)
struct valuevalue_cstring (char *ptr, ssize_t len, struct type *char_type)
struct valuevalue_string (char *ptr, ssize_t len, struct type *char_type)
static void update_search_result (struct value **result_ptr, struct value *v, int *last_boffset, int boffset, const char *name, struct type *type)
static void do_search_struct_field (const char *name, struct value *arg1, int offset, struct type *type, int looking_for_baseclass, struct value **result_ptr, int *last_boffset, struct type *outermost_type)
struct valuevalue_struct_elt (struct value **argp, struct value **args, const char *name, int *static_memfuncp, const char *err)
static struct fn_field * value_find_oload_method_list (struct value **argp, const char *method, int offset, int *num_fns, struct type **basetype, int *boffset)
int find_overload_match (struct value **args, int nargs, const char *name, enum oload_search_type method, struct value **objp, struct symbol *fsym, struct value **valp, struct symbol **symp, int *staticp, const int no_adl)
int destructor_name_p (const char *name, struct type *type)
struct valuevalue_aggregate_elt (struct type *curtype, char *name, struct type *expect_type, int want_address, enum noside noside)
static int compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
struct typevalue_rtti_indirect_type (struct value *v, int *full, int *top, int *using_enc)
struct valuevalue_full_object (struct value *argp, struct type *rtype, int xfull, int xtop, int xusing_enc)
struct valuevalue_of_this (const struct language_defn *lang)
struct valuevalue_of_this_silent (const struct language_defn *lang)
struct valuevalue_slice (struct value *array, int lowbound, int length)
struct valuevalue_literal_complex (struct value *arg1, struct value *arg2, struct type *type)

Variables

unsigned int overload_debug
int overload_resolution = 0

Enumeration Type Documentation

Enumerator:
STANDARD 
NON_STANDARD 
INCOMPATIBLE 

Definition at line 80 of file valops.c.


Function Documentation

void _initialize_valops ( void  )
struct value* address_of_variable ( struct symbol var,
const struct block b 
) [read]
static CORE_ADDR allocate_space_in_inferior ( int  len) [static]

Definition at line 211 of file valops.c.

References value_allocate_space_in_inferior(), and value_as_long().

Referenced by value_coerce_to_target().

static struct value * cast_into_complex ( struct type type,
struct value val 
) [static, read]
static enum oload_classification classify_oload_match ( struct badness_vector oload_champ_bv,
int  nargs,
int  static_offset 
) [static]
static int compare_parameters ( struct type t1,
struct type t2,
int  skip_artificial 
) [static]
int destructor_name_p ( const char *  name,
struct type type 
)

Definition at line 2994 of file valops.c.

References _, error(), len, strchr(), and type_name_no_tag_or_error().

static void do_search_struct_field ( const char *  name,
struct value arg1,
int  offset,
struct type type,
int  looking_for_baseclass,
struct value **  result_ptr,
int last_boffset,
struct type outermost_type 
) [static]
static int dynamic_cast_check_1 ( struct type desired_type,
const gdb_byte valaddr,
int  embedded_offset,
CORE_ADDR  address,
struct value val,
struct type search_type,
CORE_ADDR  arg_addr,
struct type arg_type,
struct value **  result 
) [static]
static int dynamic_cast_check_2 ( struct type desired_type,
const gdb_byte valaddr,
int  embedded_offset,
CORE_ADDR  address,
struct value val,
struct type search_type,
struct value **  result 
) [static]
struct value* find_function_in_inferior ( const char *  name,
struct objfile **  objf_p 
) [read]
static struct fn_field * find_method_list ( struct value **  argp,
const char *  method,
int  offset,
struct type type,
int num_fns,
struct type **  basetype,
int boffset 
) [static, read]
static int find_oload_champ ( struct value **  args,
int  nargs,
int  method,
int  num_fns,
struct fn_field *  fns_ptr,
struct symbol **  oload_syms,
struct badness_vector **  oload_champ_bv 
) [static]
static int find_oload_champ_namespace ( struct value **  args,
int  nargs,
const char *  func_name,
const char *  qualified_name,
struct symbol ***  oload_syms,
struct badness_vector **  oload_champ_bv,
const int  no_adl 
) [static]

Definition at line 2689 of file valops.c.

References find_oload_champ_namespace_loop().

Referenced by find_overload_match().

static int find_oload_champ_namespace_loop ( struct value **  args,
int  nargs,
const char *  func_name,
const char *  qualified_name,
int  namespace_len,
struct symbol ***  oload_syms,
struct badness_vector **  oload_champ_bv,
int oload_champ,
const int  no_adl 
) [static]
int find_overload_match ( struct value **  args,
int  nargs,
const char *  name,
enum oload_search_type  method,
struct value **  objp,
struct symbol fsym,
struct value **  valp,
struct symbol **  symp,
int staticp,
const int  no_adl 
)
static struct value* get_value_at ( struct type type,
CORE_ADDR  addr,
int  lazy 
) [static, read]
static int oload_method_static ( int  method,
struct fn_field *  fns_ptr,
int  index 
) [static]

Definition at line 2949 of file valops.c.

References TYPE_FN_FIELD_STATIC_P.

Referenced by find_oload_champ(), and find_overload_match().

void read_value_memory ( struct value val,
int  embedded_offset,
int  stack,
CORE_ADDR  memaddr,
gdb_byte buffer,
size_t  length 
)
static struct value * search_struct_field ( const char *  name,
struct value arg1,
int  offset,
struct type type,
int  looking_for_baseclass 
) [static, read]

Definition at line 2004 of file valops.c.

References do_search_struct_field().

Referenced by find_overload_match(), value_cast_structs(), and value_struct_elt().

static struct value * search_struct_method ( const char *  name,
struct value **  arg1p,
struct value **  args,
int  offset,
int static_memfuncp,
struct type type 
) [static, read]
static void show_overload_resolution ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
) [static]

Definition at line 118 of file valops.c.

References _, and fprintf_filtered().

static int typecmp ( int  staticp,
int  varargs,
int  nargs,
struct field  t1[],
struct value t2[] 
) [static]
static void update_search_result ( struct value **  result_ptr,
struct value v,
int last_boffset,
int  boffset,
const char *  name,
struct type type 
) [static]

Definition at line 1809 of file valops.c.

References _, error(), and TYPE_SAFE_NAME.

Referenced by do_search_struct_field().

struct value* value_addr ( struct value arg1) [read]
struct value* value_aggregate_elt ( struct type curtype,
char *  name,
struct type expect_type,
int  want_address,
enum noside noside   
) [read]
struct value* value_allocate_space_in_inferior ( int  len) [read]
struct value* value_array ( int  lowbound,
int  highbound,
struct value **  elemvec 
) [read]
struct value* value_assign ( struct value toval,
struct value fromval 
) [read]
struct value* value_at ( struct type type,
CORE_ADDR  addr 
) [read]
struct value* value_at_lazy ( struct type type,
CORE_ADDR  addr 
) [read]
struct value* value_cast ( struct type type,
struct value arg2 
) [read]

Definition at line 354 of file valops.c.

References _, allocate_value(), language_defn::c_style_arrays, cast_into_complex(), check_typedef(), CHECK_TYPEDEF, coerce_ref(), cplus_make_method_ptr(), create_array_type(), create_range_type(), current_language, decimal_convert(), decimal_from_floating(), decimal_from_integral(), deprecated_set_value_type(), error(), extract_unsigned_integer(), gdb_assert, gdbarch_addr_bit(), gdbarch_byte_order(), get_discrete_bounds(), get_type_arch(), HOST_CHAR_BIT, LONGEST, lval_memory, not_lval, set_value_enclosing_type(), set_value_pointed_to_offset(), TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_COMPLEX, TYPE_CODE_DECFLOAT, TYPE_CODE_ENUM, TYPE_CODE_FLT, TYPE_CODE_FUNC, TYPE_CODE_INT, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHODPTR, TYPE_CODE_PTR, TYPE_CODE_RANGE, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_CODE_VOID, TYPE_INDEX_TYPE, TYPE_LENGTH, TYPE_NAME, TYPE_TARGET_TYPE, TYPE_VECTOR, value_address(), value_as_double(), value_as_long(), value_at_lazy(), value_cast(), value_cast_pointers(), value_cast_structs(), value_coerce_array(), value_coerce_function(), value_contents(), value_contents_writeable(), value_copy(), value_from_decfloat(), value_from_double(), value_from_longest(), VALUE_LVAL, value_ref(), value_type(), value_zero(), and warning().

Referenced by aarch64_push_dummy_call(), ada_coerce_to_simple_array_ptr(), ada_get_tsd_from_tag(), ada_promote_array_of_integrals(), ada_tag_value_at_base_address(), ada_val_print_1(), ada_value_assign(), ada_value_cast(), ada_value_ptr_subscript(), ada_value_slice(), adjust_value_for_child_access(), alpha_push_dummy_call(), binop_promote(), compute_exception(), cplus_describe_child(), desc_bounds(), evaluate_subexp_java(), evaluate_subexp_modula2(), evaluate_subexp_standard(), evaluate_subexp_with_coercion(), execute_stack_op(), gnuv2_value_rtti_type(), gnuv2_virtual_fn_field(), gnuv3_get_typeid(), gnuv3_get_virtual_fn(), gnuv3_method_ptr_to_value(), gnuv3_virtual_fn_field(), hppa64_push_dummy_call(), lm32_push_dummy_call(), m88k_store_arguments(), opencl_value_cast(), return_command(), s390_unwind_pseudo_register(), sparc32_store_arguments(), sparc64_store_arguments(), thin_data_pntr(), unop_promote(), value_arg_coerce(), value_assign(), value_assign_to_component(), value_cast(), value_dynamic_cast(), value_fn_field(), value_literal_complex(), value_reinterpret_cast(), value_vector_widen(), varobj_create(), wrap_value_cast(), and xtensa_push_dummy_call().

struct value* value_cast_pointers ( struct type type,
struct value arg2,
int  subclass_check 
) [read]
static struct value* value_cast_structs ( struct type type,
struct value v2 
) [static, read]
struct value* value_coerce_array ( struct value arg1) [read]
struct value* value_coerce_function ( struct value arg1) [read]
struct value* value_coerce_to_target ( struct value val) [read]
struct value* value_cstring ( char *  ptr,
ssize_t  len,
struct type char_type 
) [read]
struct value* value_dynamic_cast ( struct type type,
struct value arg 
) [read]
static struct fn_field* value_find_oload_method_list ( struct value **  argp,
const char *  method,
int  offset,
int num_fns,
struct type **  basetype,
int boffset 
) [static, read]
struct value* value_full_object ( struct value argp,
struct type rtype,
int  xfull,
int  xtop,
int  xusing_enc 
) [read]
struct value* value_ind ( struct value arg1) [read]
struct value* value_literal_complex ( struct value arg1,
struct value arg2,
struct type type 
) [read]
static struct value* value_maybe_namespace_elt ( const struct type curtype,
char *  name,
int  want_address,
enum noside noside   
) [static, read]
static struct value* value_namespace_elt ( const struct type curtype,
char *  name,
int  want_address,
enum noside noside   
) [static, read]

Referenced by value_aggregate_elt().

struct value* value_of_this ( const struct language_defn lang) [read]
struct value* value_of_this_silent ( const struct language_defn lang) [read]

Definition at line 3515 of file valops.c.

References RETURN_MASK_ERROR, TRY_CATCH, and value_of_this().

struct value* value_of_variable ( struct symbol var,
const struct block b 
) [read]
struct value* value_one ( struct type type) [read]
struct value* value_ref ( struct value arg1) [read]
struct value* value_reinterpret_cast ( struct type type,
struct value arg 
) [read]
struct value* value_repeat ( struct value arg1,
int  count 
) [read]
struct type* value_rtti_indirect_type ( struct value v,
int full,
int top,
int using_enc 
) [read]
struct value* value_slice ( struct value array,
int  lowbound,
int  length 
) [read]
struct value* value_string ( char *  ptr,
ssize_t  len,
struct type char_type 
) [read]
struct value* value_struct_elt ( struct value **  argp,
struct value **  args,
const char *  name,
int static_memfuncp,
const char *  err 
) [read]
static struct value* value_struct_elt_for_reference ( struct type domain,
int  offset,
struct type curtype,
char *  name,
struct type intype,
int  want_address,
enum noside noside   
) [static, read]

Referenced by value_aggregate_elt().

struct value* value_zero ( struct type type,
enum lval_type  lv 
) [read]

Variable Documentation

unsigned int overload_debug

Definition at line 122 of file gdbtypes.c.

Referenced by _initialize_gdbtypes(), find_oload_champ(), and rank_one_type().

Definition at line 116 of file valops.c.

Referenced by evaluate_subexp_standard().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines