GDB (xrefs)
Loading...
Searching...
No Matches
Macros | Functions
valarith.c File Reference
#include "defs.h"
#include "value.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "target.h"
#include "language.h"
#include "target-float.h"
#include "infcall.h"
#include "gdbsupport/byte-vector.h"
#include "gdbarch.h"

Go to the source code of this file.

Macros

#define TRUNCATION_TOWARDS_ZERO   ((-5 / 2) == -2)
 

Functions

static struct valuevalue_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound)
 
static LONGEST find_size_for_pointer_math (struct type *ptr_type)
 
struct valuevalue_ptradd (struct value *arg1, LONGEST arg2)
 
LONGEST value_ptrdiff (struct value *arg1, struct value *arg2)
 
struct valuevalue_subscript (struct value *array, LONGEST index)
 
int binop_types_user_defined_p (enum exp_opcode op, struct type *type1, struct type *type2)
 
int binop_user_defined_p (enum exp_opcode op, struct value *arg1, struct value *arg2)
 
int unop_user_defined_p (enum exp_opcode op, struct value *arg1)
 
static struct valuevalue_user_defined_cpp_op (gdb::array_view< value * > args, char *oper, int *static_memfuncp, enum noside noside)
 
static struct valuevalue_user_defined_op (struct value **argp, gdb::array_view< value * > args, char *name, int *static_memfuncp, enum noside noside)
 
struct valuevalue_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op, enum exp_opcode otherop, enum noside noside)
 
struct valuevalue_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
 
struct valuevalue_concat (struct value *arg1, struct value *arg2)
 
static LONGEST integer_pow (LONGEST v1, LONGEST v2)
 
static void value_args_as_target_float (struct value *arg1, struct value *arg2, gdb_byte *x, struct type **eff_type_x, gdb_byte *y, struct type **eff_type_y)
 
static struct valuefixed_point_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
 
static struct typepromotion_type (struct type *type1, struct type *type2)
 
static struct valuescalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
 
static struct valuecomplex_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
 
static int type_length_bits (type *type)
 
static bool check_valid_shift_count (int op, type *result_type, type *shift_count_type, ULONGEST shift_count)
 
struct valuevalue_vector_widen (struct value *scalar_value, struct type *vector_type)
 
static struct valuevector_binop (struct value *val1, struct value *val2, enum exp_opcode op)
 
struct valuevalue_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
 
bool value_logical_not (struct value *arg1)
 
static int value_strcmp (struct value *arg1, struct value *arg2)
 
int value_equal (struct value *arg1, struct value *arg2)
 
int value_equal_contents (struct value *arg1, struct value *arg2)
 
int value_less (struct value *arg1, struct value *arg2)
 
struct valuevalue_pos (struct value *arg1)
 
struct valuevalue_neg (struct value *arg1)
 
struct valuevalue_complement (struct value *arg1)
 
int value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
 
int value_in (struct value *element, struct value *set)
 

Macro Definition Documentation

◆ TRUNCATION_TOWARDS_ZERO

#define TRUNCATION_TOWARDS_ZERO   ((-5 / 2) == -2)

Definition at line 41 of file valarith.c.

Function Documentation

◆ binop_types_user_defined_p()

int binop_types_user_defined_p ( enum exp_opcode  op,
struct type type1,
struct type type2 
)

◆ binop_user_defined_p()

int binop_user_defined_p ( enum exp_opcode  op,
struct value arg1,
struct value arg2 
)

◆ check_valid_shift_count()

static bool check_valid_shift_count ( int  op,
type result_type,
type shift_count_type,
ULONGEST  shift_count 
)
static

◆ complex_binop()

static struct value * complex_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op 
)
static

◆ find_size_for_pointer_math()

static LONGEST find_size_for_pointer_math ( struct type ptr_type)
static

Definition at line 51 of file valarith.c.

References check_typedef(), type::code(), name, type::name(), type::target_type(), and type_length_units().

Referenced by value_ptradd().

◆ fixed_point_binop()

static struct value * fixed_point_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op 
)
static

◆ integer_pow()

static LONGEST integer_pow ( LONGEST  v1,
LONGEST  v2 
)
static

Definition at line 718 of file valarith.c.

Referenced by scalar_binop().

◆ promotion_type()

static struct type * promotion_type ( struct type type1,
struct type type2 
)
static

Definition at line 921 of file valarith.c.

References is_floating_type(), type::is_unsigned(), and type::length().

Referenced by complex_binop(), and scalar_binop().

◆ scalar_binop()

static struct value * scalar_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op 
)
static

◆ type_length_bits()

static int type_length_bits ( type type)
static

◆ unop_user_defined_p()

int unop_user_defined_p ( enum exp_opcode  op,
struct value arg1 
)

◆ value_args_as_target_float()

static void value_args_as_target_float ( struct value arg1,
struct value arg2,
gdb_byte *  x,
struct type **  eff_type_x,
gdb_byte *  y,
struct type **  eff_type_y 
)
static

◆ value_binop()

struct value * value_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op 
)

◆ value_bit_index()

int value_bit_index ( struct type type,
const gdb_byte *  valaddr,
int  index 
)

◆ value_complement()

struct value * value_complement ( struct value arg1)

◆ value_concat()

struct value * value_concat ( struct value arg1,
struct value arg2 
)

◆ value_equal()

int value_equal ( struct value arg1,
struct value arg2 
)

◆ value_equal_contents()

int value_equal_contents ( struct value arg1,
struct value arg2 
)

Definition at line 1800 of file valarith.c.

References check_typedef(), type::code(), type::length(), value_contents(), and value_type().

Referenced by watchpoint_check().

◆ value_in()

int value_in ( struct value element,
struct value set 
)

◆ value_less()

int value_less ( struct value arg1,
struct value arg2 
)

◆ value_logical_not()

bool value_logical_not ( struct value arg1)

◆ value_neg()

struct value * value_neg ( struct value arg1)

◆ value_pos()

struct value * value_pos ( struct value arg1)

◆ value_ptradd()

struct value * value_ptradd ( struct value arg1,
LONGEST  arg2 
)

◆ value_ptrdiff()

LONGEST value_ptrdiff ( struct value arg1,
struct value arg2 
)

◆ value_strcmp()

static int value_strcmp ( struct value arg1,
struct value arg2 
)
static

Definition at line 1698 of file valarith.c.

References type::length(), s1, s2, value_contents(), and value_type().

Referenced by value_equal(), and value_less().

◆ value_subscript()

struct value * value_subscript ( struct value array,
LONGEST  index 
)

◆ value_subscripted_rvalue()

static struct value * value_subscripted_rvalue ( struct value array,
LONGEST  index,
LONGEST  lowerbound 
)
static

◆ value_user_defined_cpp_op()

static struct value * value_user_defined_cpp_op ( gdb::array_view< value * >  args,
char *  oper,
int *  static_memfuncp,
enum noside  noside 
)
static

Definition at line 311 of file valarith.c.

References BOTH, find_overload_match(), value_ind(), and value_of_variable().

Referenced by value_user_defined_op().

◆ value_user_defined_op()

static struct value * value_user_defined_op ( struct value **  argp,
gdb::array_view< value * >  args,
char *  name,
int *  static_memfuncp,
enum noside  noside 
)
static

◆ value_vector_widen()

struct value * value_vector_widen ( struct value scalar_value,
struct type vector_type 
)

◆ value_x_binop()

struct value * value_x_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op,
enum exp_opcode  otherop,
enum noside noside noside   
)

◆ value_x_unop()

struct value * value_x_unop ( struct value arg1,
enum exp_opcode  op,
enum noside noside noside   
)

◆ vector_binop()

static struct value * vector_binop ( struct value val1,
struct value val2,
enum exp_opcode  op 
)
static