GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
/tmp/gdb-13.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 "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 "gdbsupport/gdb_obstack.h"
#include "objfiles.h"
#include "typeprint.h"
#include <ctype.h>
#include "expop.h"
#include "c-exp.h"
#include "inferior.h"

Go to the source code of this file.

Classes

class  fake_method
 
struct  fake_method::m_type
 

Namespaces

namespace  expr
 

Functions

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 type *expect_type)
 
struct valueevaluate_type (struct expression *exp)
 
void fetch_subexp_value (struct expression *exp, expr::operation *op, struct value **valp, struct value **resultp, std::vector< value_ref_ptr > *val_chain, bool preserve_errors)
 
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)
 
valueevaluate_subexp_do_call (expression *exp, enum noside noside, value *callee, gdb::array_view< value * > argvec, const char *function_name, type *default_return_type)
 
static void expr::add_struct_fields (struct type *type, completion_list &output, const char *fieldname, int namelen, const char *prefix)
 
static bool is_integral_or_integral_reference (struct type *type)
 
struct valueeval_op_scope (struct type *expect_type, struct expression *exp, enum noside noside, struct type *type, const char *string)
 
struct valueeval_op_var_entry_value (struct type *expect_type, struct expression *exp, enum noside noside, symbol *sym)
 
struct valueeval_op_var_msym_value (struct type *expect_type, struct expression *exp, enum noside noside, bool outermost_p, bound_minimal_symbol msymbol)
 
struct valueeval_op_func_static_var (struct type *expect_type, struct expression *exp, enum noside noside, value *func, const char *var)
 
struct valueeval_op_register (struct type *expect_type, struct expression *exp, enum noside noside, const char *name)
 
struct valueeval_op_objc_selector (struct type *expect_type, struct expression *exp, enum noside noside, const char *sel)
 
struct valueeval_op_ternop (struct type *expect_type, struct expression *exp, enum noside noside, struct value *array, struct value *low, struct value *upper)
 
struct valueeval_op_structop_struct (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, const char *string)
 
struct valueeval_op_structop_ptr (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, const char *string)
 
struct valueeval_op_member (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2)
 
struct valueeval_op_add (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2)
 
struct valueeval_op_sub (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2)
 
struct valueeval_op_binary (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_subscript (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_equal (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_notequal (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_less (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_gtr (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_geq (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_leq (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_repeat (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
struct valueeval_op_plus (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
 
struct valueeval_op_neg (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
 
struct valueeval_op_complement (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
 
struct valueeval_op_lognot (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
 
struct valueeval_op_ind (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1)
 
struct valueeval_op_alignof (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1)
 
struct valueeval_op_memval (struct type *expect_type, struct expression *exp, enum noside noside, struct value *arg1, struct type *type)
 
struct valueeval_op_preinc (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
 
struct valueeval_op_predec (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
 
struct valueeval_op_postinc (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
 
struct valueeval_op_postdec (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
 
struct valueeval_op_type (struct type *expect_type, struct expression *exp, enum noside noside, struct type *type)
 
struct valueeval_binop_assign_modify (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
 
static struct valueeval_op_objc_msgcall (struct type *expect_type, struct expression *exp, enum noside noside, CORE_ADDR selector, value *target, gdb::array_view< value * > args)
 
static struct valueeval_multi_subscript (struct type *expect_type, struct expression *exp, enum noside noside, value *arg1, gdb::array_view< value * > args)
 
static valueevaluate_subexp_for_address_base (struct expression *exp, enum noside noside, value *x)
 
static valueevaluate_subexp_for_sizeof_base (struct expression *exp, struct type *type)
 
struct typeparse_and_eval_type (const char *p, int length)
 

Function Documentation

◆ binop_promote()

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

◆ eval_binop_assign_modify()

struct value * eval_binop_assign_modify ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_multi_subscript()

static struct value * eval_multi_subscript ( struct type expect_type,
struct expression exp,
enum noside  noside,
value arg1,
gdb::array_view< value * >  args 
)
static

◆ eval_op_add()

struct value * eval_op_add ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value arg1,
struct value arg2 
)

◆ eval_op_alignof()

struct value * eval_op_alignof ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value arg1 
)

◆ eval_op_binary()

struct value * eval_op_binary ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_complement()

struct value * eval_op_complement ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1 
)

◆ eval_op_equal()

struct value * eval_op_equal ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_func_static_var()

struct value * eval_op_func_static_var ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
value func,
const char *  var 
)

◆ eval_op_geq()

struct value * eval_op_geq ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_gtr()

struct value * eval_op_gtr ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_ind()

struct value * eval_op_ind ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value arg1 
)

◆ eval_op_leq()

struct value * eval_op_leq ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_less()

struct value * eval_op_less ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_lognot()

struct value * eval_op_lognot ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1 
)

◆ eval_op_member()

struct value * eval_op_member ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value arg1,
struct value arg2 
)

◆ eval_op_memval()

struct value * eval_op_memval ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value arg1,
struct type type 
)

◆ eval_op_neg()

struct value * eval_op_neg ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1 
)

◆ eval_op_notequal()

struct value * eval_op_notequal ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_objc_msgcall()

static struct value * eval_op_objc_msgcall ( struct type expect_type,
struct expression exp,
enum noside  noside,
CORE_ADDR  selector,
value target,
gdb::array_view< value * >  args 
)
static

◆ eval_op_objc_selector()

struct value * eval_op_objc_selector ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
const char *  sel 
)

◆ eval_op_plus()

struct value * eval_op_plus ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1 
)

◆ eval_op_postdec()

struct value * eval_op_postdec ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1 
)

◆ eval_op_postinc()

struct value * eval_op_postinc ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1 
)

◆ eval_op_predec()

struct value * eval_op_predec ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1 
)

◆ eval_op_preinc()

struct value * eval_op_preinc ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1 
)

◆ eval_op_register()

struct value * eval_op_register ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
const char *  name 
)

◆ eval_op_repeat()

struct value * eval_op_repeat ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_scope()

struct value * eval_op_scope ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct type type,
const char *  string 
)

Definition at line 1077 of file eval.c.

References value_aggregate_elt().

Referenced by expr::scope_operation::evaluate().

◆ eval_op_structop_ptr()

struct value * eval_op_structop_ptr ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value arg1,
const char *  string 
)

◆ eval_op_structop_struct()

struct value * eval_op_structop_struct ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value arg1,
const char *  string 
)

◆ eval_op_sub()

struct value * eval_op_sub ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value arg1,
struct value arg2 
)

◆ eval_op_subscript()

struct value * eval_op_subscript ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ eval_op_ternop()

struct value * eval_op_ternop ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct value array,
struct value low,
struct value upper 
)

Definition at line 1199 of file eval.c.

References value_as_long(), and value_slice().

Referenced by expr::ternop_slice_operation::evaluate().

◆ eval_op_type()

struct value * eval_op_type ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
struct type type 
)

Definition at line 1868 of file eval.c.

References allocate_value(), and EVAL_AVOID_SIDE_EFFECTS.

Referenced by expr::type_operation::evaluate().

◆ eval_op_var_entry_value()

struct value * eval_op_var_entry_value ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
symbol sym 
)

◆ eval_op_var_msym_value()

struct value * eval_op_var_msym_value ( struct type expect_type,
struct expression exp,
enum noside noside noside  ,
bool  outermost_p,
bound_minimal_symbol  msymbol 
)

◆ evaluate_expression()

struct value * evaluate_expression ( struct expression exp,
struct type expect_type 
)

◆ evaluate_subexp_do_call()

value * evaluate_subexp_do_call ( expression exp,
enum noside noside noside  ,
value callee,
gdb::array_view< value * >  argvec,
const char *  function_name,
type default_return_type 
)

◆ evaluate_subexp_for_address_base()

static value * evaluate_subexp_for_address_base ( struct expression exp,
enum noside  noside,
value x 
)
static

◆ evaluate_subexp_for_sizeof_base()

static value * evaluate_subexp_for_sizeof_base ( struct expression exp,
struct type type 
)
static

◆ evaluate_type()

struct value * evaluate_type ( struct expression exp)

◆ evaluate_var_msym_value()

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

◆ evaluate_var_value()

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

◆ fetch_subexp_value()

void fetch_subexp_value ( struct expression exp,
expr::operation op,
struct value **  valp,
struct value **  resultp,
std::vector< value_ref_ptr > *  val_chain,
bool  preserve_errors 
)

◆ is_integral_or_integral_reference()

static bool is_integral_or_integral_reference ( struct type type)
static

Definition at line 1063 of file eval.c.

References check_typedef(), is_integral_type(), type::target_type(), and TYPE_IS_REFERENCE.

Referenced by eval_op_add(), and eval_op_sub().

◆ 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 ( const char *  p,
int  length 
)

Definition at line 2902 of file eval.c.

References expr::unop_cast_operation::get_type(), 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 
)