GDB (xrefs)
Classes | Functions | Variables
/tmp/gdb-8.1/gdb/eval.c File Reference
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "expression.h"
#include "target.h"
#include "frame.h"
#include "gdbthread.h"
#include "language.h"
#include "f-lang.h"
#include "cp-abi.h"
#include "infcall.h"
#include "objc-lang.h"
#include "block.h"
#include "parser-defs.h"
#include "cp-support.h"
#include "ui-out.h"
#include "regcache.h"
#include "user-regs.h"
#include "valprint.h"
#include "gdb_obstack.h"
#include "objfiles.h"
#include "typeprint.h"
#include <ctype.h>

Go to the source code of this file.

Classes

class  fake_method
 
struct  fake_method::m_type
 

Functions

static struct valueevaluate_subexp_for_sizeof (struct expression *, int *, enum noside)
 
static struct valueevaluate_subexp_for_address (struct expression *, int *, enum noside)
 
static valueevaluate_subexp_for_cast (expression *exp, int *pos, enum noside noside, struct type *type)
 
static struct valueevaluate_struct_tuple (struct value *, struct expression *, int *, enum noside, int)
 
static LONGEST init_array_element (struct value *, struct value *, struct expression *, int *, enum noside, LONGEST, LONGEST)
 
struct valueevaluate_subexp (struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
 
CORE_ADDR parse_and_eval_address (const char *exp)
 
LONGEST parse_and_eval_long (const char *exp)
 
struct valueparse_and_eval (const char *exp)
 
struct valueparse_to_comma_and_eval (const char **expp)
 
struct valueevaluate_expression (struct expression *exp)
 
struct valueevaluate_type (struct expression *exp)
 
struct valueevaluate_subexpression_type (struct expression *exp, int subexp)
 
void fetch_subexp_value (struct expression *exp, int *pc, struct value **valp, struct value **resultp, struct value **val_chain, int preserve_errors)
 
char * extract_field_op (struct expression *exp, int *subexp)
 
static struct valuevalue_f90_subarray (struct value *array, struct expression *exp, int *pos, enum noside noside)
 
void unop_promote (const struct language_defn *language, struct gdbarch *gdbarch, struct value **arg1)
 
void binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, struct value **arg1, struct value **arg2)
 
static int ptrmath_type_p (const struct language_defn *lang, struct type *type)
 
valueevaluate_var_value (enum noside noside, const block *blk, symbol *var)
 
valueevaluate_var_msym_value (enum noside noside, struct objfile *objfile, minimal_symbol *msymbol)
 
valueeval_skip_value (expression *exp)
 
static valueeval_call (expression *exp, enum noside noside, int nargs, value **argvec, const char *function_name, type *default_return_type)
 
static valueevaluate_funcall (type *expect_type, expression *exp, int *pos, enum noside noside)
 
struct valueevaluate_subexp_standard (struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
 
struct valueevaluate_subexp_with_coercion (struct expression *exp, int *pos, enum noside noside)
 
static valueevaluate_subexp_for_cast (expression *exp, int *pos, enum noside noside, struct type *to_type)
 
struct typeparse_and_eval_type (char *p, int length)
 
int calc_f77_array_dims (struct type *array_type)
 

Variables

int overload_resolution
 

Function Documentation

◆ binop_promote()

void binop_promote ( const struct language_defn language,
struct gdbarch gdbarch,
struct value **  arg1,
struct value **  arg2 
)

◆ calc_f77_array_dims()

int calc_f77_array_dims ( struct type array_type)

Definition at line 3280 of file eval.c.

References _, error(), TYPE_CODE, TYPE_CODE_ARRAY, and TYPE_TARGET_TYPE.

Referenced by evaluate_subexp_standard(), and f77_print_array().

◆ eval_call()

static value* eval_call ( expression exp,
enum noside  noside,
int  nargs,
value **  argvec,
const char *  function_name,
type default_return_type 
)
static

◆ eval_skip_value()

value* eval_skip_value ( expression exp)

◆ evaluate_expression()

struct value* evaluate_expression ( struct expression exp)

◆ evaluate_funcall()

static value* evaluate_funcall ( type expect_type,
expression exp,
int *  pos,
enum noside  noside 
)
static

◆ evaluate_struct_tuple()

static struct value* evaluate_struct_tuple ( struct value struct_val,
struct expression exp,
int *  pos,
enum noside noside  ,
int  nargs 
)
static

◆ evaluate_subexp()

struct value* evaluate_subexp ( struct type expect_type,
struct expression exp,
int *  pos,
enum noside noside   
)

◆ evaluate_subexp_for_address()

static struct value* evaluate_subexp_for_address ( struct expression exp,
int *  pos,
enum noside noside   
)
static

◆ evaluate_subexp_for_cast() [1/2]

static value* evaluate_subexp_for_cast ( expression exp,
int *  pos,
enum noside  noside,
struct type type 
)
static

◆ evaluate_subexp_for_cast() [2/2]

static value* evaluate_subexp_for_cast ( expression exp,
int *  pos,
enum noside  noside,
struct type to_type 
)
static

◆ evaluate_subexp_for_sizeof()

static struct value* evaluate_subexp_for_sizeof ( struct expression exp,
int *  pos,
enum noside noside   
)
static

◆ evaluate_subexp_standard()

struct value* evaluate_subexp_standard ( struct type expect_type,
struct expression exp,
int *  pos,
enum noside noside   
)

Definition at line 1240 of file eval.c.

References _, access_value_history(), frame_info::addr, allocate_repeat_value(), allocate_value(), binop_promote(), binop_user_defined_p(), exp_element::block, block_symbol::block, block_for_pc(), builtin_type::builtin_data_ptr, builtin_type::builtin_int, builtin_type::builtin_long, builtin_type(), BYTES_TO_EXP_ELEM, calc_f77_array_dims(), call_function_by_hand(), CATCH, check_typedef(), code, coerce_ref(), cplus_method_ptr_to_value(), cplus_typeid(), cplus_typeid_type(), current_target, deprecated_set_value_type(), expression::elts, END_CATCH, error(), error_unknown_type(), EVAL_AVOID_SIDE_EFFECTS, eval_call(), EVAL_NORMAL, EVAL_SKIP, eval_skip_value(), evaluate_funcall(), evaluate_struct_tuple(), evaluate_subexp(), evaluate_subexp_for_address(), evaluate_subexp_for_cast(), evaluate_subexp_for_sizeof(), evaluate_subexp_with_coercion(), evaluate_var_msym_value(), evaluate_var_value(), f77_get_lowerbound(), find_function_addr(), find_function_in_inferior(), find_pc_function(), flags, exp_element::floatconst, func, gdb_assert, gdb_assert_not_reached, expression::gdbarch, gdbarch_bits_big_endian(), gdbarch_convert_from_func_ptr_addr(), gdbarch_num_pseudo_regs(), gdbarch_num_regs(), get_discrete_bounds(), get_selected_frame(), get_user_print_options(), init_array_element(), exp_element::internalvar, is_integral_type(), language_bool_type(), expression::language_defn, language_string_char_type(), exp_element::longconst, longest_to_int(), lookup_child_selector(), lookup_function_type(), lookup_lvalue_reference_type(), lookup_minimal_symbol(), lookup_pointer_type(), lookup_symbol(), lval_memory, MAX_FORTRAN_DIMS, memset(), exp_element::msymbol, MSYMBOL_PRINT_NAME, name, NOT_FOUND_ERROR, not_lval, NULL_TYPE, value_print_options::objectprint, exp_element::objfile, exp_element::opcode, ptrmath_type_p(), register_type(), RETURN_MASK_ERROR, selector, exp_element::string, exp_element::symbol, block_symbol::symbol, SYMBOL_COMPUTED_OPS, SYMBOL_PRINT_NAME, SYMBOL_TYPE, TARGET_CHAR_BIT, throw_exception(), TRY, exp_element::type, type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_ENUM, TYPE_CODE_ERROR, TYPE_CODE_FUNC, TYPE_CODE_INT, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHODPTR, TYPE_CODE_PTR, TYPE_CODE_RANGE, TYPE_CODE_SET, TYPE_CODE_STRING, TYPE_CODE_STRUCT, TYPE_CODE_TYPEDEF, TYPE_INDEX_TYPE, TYPE_IS_REFERENCE, TYPE_LENGTH, TYPE_NAME, TYPE_SELF_TYPE, TYPE_TARGET_TYPE, unop_promote(), unop_user_defined_p(), user_reg_map_name_to_regnum(), using_struct_return(), value_address(), value_aggregate_elt(), value_array(), value_as_address(), value_as_long(), value_assign(), value_at_lazy(), value_binop(), value_cast(), value_cast_pointers(), value_complement(), value_concat(), value_contents(), value_contents_raw(), value_dynamic_cast(), value_equal(), value_f90_subarray(), value_from_contents(), value_from_longest(), value_from_pointer(), value_ind(), value_less(), value_literal_complex(), value_logical_not(), VALUE_LVAL, value_neg(), value_non_lval(), value_nsstring(), value_of_internalvar(), value_of_register(), value_of_this(), value_of_variable(), value_one(), value_pos(), value_ptradd(), value_ptrdiff(), value_reinterpret_cast(), value_repeat(), value_rtti_indirect_type(), value_slice(), value_string(), value_struct_elt(), value_subscript(), value_subscripted_rvalue(), value_type(), value_x_binop(), value_x_unop(), value_zero(), VAR_DOMAIN, and warning().

Referenced by ada_evaluate_subexp(), dtrace_probe::evaluate_argument(), stap_probe::evaluate_argument(), evaluate_subexp_c(), evaluate_subexp_modula2(), rust_evaluate_funcall(), and rust_evaluate_subexp().

◆ evaluate_subexp_with_coercion()

struct value* evaluate_subexp_with_coercion ( struct expression exp,
int *  pos,
enum noside noside   
)

◆ evaluate_subexpression_type()

struct value* evaluate_subexpression_type ( struct expression exp,
int  subexp 
)

Definition at line 166 of file eval.c.

References EVAL_AVOID_SIDE_EFFECTS, evaluate_subexp(), and NULL_TYPE.

Referenced by parse_expression_for_completion().

◆ evaluate_type()

struct value* evaluate_type ( struct expression exp)

◆ evaluate_var_msym_value()

value* evaluate_var_msym_value ( enum noside noside  ,
struct objfile objfile,
minimal_symbol msymbol 
)

◆ evaluate_var_value()

value* evaluate_var_value ( enum noside noside  ,
const block blk,
symbol var 
)

◆ extract_field_op()

char* extract_field_op ( struct expression exp,
int *  subexp 
)

◆ fetch_subexp_value()

void fetch_subexp_value ( struct expression exp,
int *  pc,
struct value **  valp,
struct value **  resultp,
struct value **  val_chain,
int  preserve_errors 
)

◆ init_array_element()

static LONGEST init_array_element ( struct value array,
struct value element,
struct expression exp,
int *  pos,
enum noside noside  ,
LONGEST  low_bound,
LONGEST  high_bound 
)
static

◆ parse_and_eval()

struct value* parse_and_eval ( const char *  exp)

◆ parse_and_eval_address()

CORE_ADDR parse_and_eval_address ( const char *  exp)

◆ parse_and_eval_long()

LONGEST parse_and_eval_long ( const char *  exp)

◆ parse_and_eval_type()

struct type* parse_and_eval_type ( char *  p,
int  length 
)

Definition at line 3264 of file eval.c.

References _, error(), type::length, and parse_expression().

Referenced by safe_parse_type().

◆ parse_to_comma_and_eval()

struct value* parse_to_comma_and_eval ( const char **  expp)

◆ ptrmath_type_p()

static int ptrmath_type_p ( const struct language_defn lang,
struct type type 
)
static

◆ unop_promote()

void unop_promote ( const struct language_defn language,
struct gdbarch gdbarch,
struct value **  arg1 
)

◆ value_f90_subarray()

static struct value* value_f90_subarray ( struct value array,
struct expression exp,
int *  pos,
enum noside  noside 
)
static

Variable Documentation

◆ overload_resolution

int overload_resolution

Definition at line 111 of file valops.c.

Referenced by _initialize_valops(), and evaluate_funcall().