GDB (xrefs)
Defines | Functions
/home/stan/gdb/src/gdb/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 "gdb_string.h"
#include "doublest.h"
#include "dfp.h"
#include <math.h>
#include "infcall.h"
#include "exceptions.h"

Go to the source code of this file.

Defines

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

Functions

void _initialize_valarith (void)
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)
struct valuevalue_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
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 (struct value **args, int nargs, char *operator, int *static_memfuncp)
static struct valuevalue_user_defined_op (struct value **argp, struct value **args, char *name, int *static_memfuncp, int nargs)
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 ULONGEST uinteger_pow (ULONGEST v1, LONGEST v2)
static void value_args_as_decimal (struct value *arg1, struct value *arg2, gdb_byte *x, int *len_x, enum bfd_endian *byte_order_x, gdb_byte *y, int *len_y, enum bfd_endian *byte_order_y)
static struct valuescalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
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)
int 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)

Define Documentation

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

Definition at line 38 of file valarith.c.

Referenced by scalar_binop().


Function Documentation

void _initialize_valarith ( void  )
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 
)

Definition at line 255 of file valarith.c.

References binop_types_user_defined_p(), and value_type().

Referenced by evaluate_subexp_standard().

static LONGEST find_size_for_pointer_math ( struct type ptr_type) [static]
static LONGEST integer_pow ( LONGEST  v1,
LONGEST  v2 
) [static]

Definition at line 769 of file valarith.c.

References _, error(), L, and LONGEST.

Referenced by scalar_binop().

static struct value* scalar_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op 
) [static, read]
static ULONGEST uinteger_pow ( ULONGEST  v1,
LONGEST  v2 
) [static]

Definition at line 800 of file valarith.c.

References _, error(), L, and ULONGEST.

Referenced by scalar_binop().

int unop_user_defined_p ( enum exp_opcode  op,
struct value arg1 
)
static void value_args_as_decimal ( struct value arg1,
struct value arg2,
gdb_byte x,
int len_x,
enum bfd_endian *  byte_order_x,
gdb_byte y,
int len_y,
enum bfd_endian *  byte_order_y 
) [static]
struct value* value_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op 
) [read]
int value_bit_index ( struct type type,
const gdb_byte valaddr,
int  index 
)
struct value* value_complement ( struct value arg1) [read]
struct value* value_concat ( struct value arg1,
struct value arg2 
) [read]
int value_equal ( struct value arg1,
struct value arg2 
)
int value_equal_contents ( struct value arg1,
struct value arg2 
)

Definition at line 1625 of file valarith.c.

References check_typedef(), memcmp(), TYPE_CODE, TYPE_LENGTH, value_contents(), and value_type().

Referenced by watchpoint_check().

int value_in ( struct value element,
struct value set 
)
int value_less ( struct value arg1,
struct value arg2 
)
int value_logical_not ( struct value arg1)
struct value* value_neg ( struct value arg1) [read]
struct value* value_pos ( struct value arg1) [read]
struct value* value_ptradd ( struct value arg1,
LONGEST  arg2 
) [read]
LONGEST value_ptrdiff ( struct value arg1,
struct value arg2 
)
static int value_strcmp ( struct value arg1,
struct value arg2 
) [static]

Definition at line 1513 of file valarith.c.

References len, TYPE_LENGTH, value_contents(), and value_type().

Referenced by value_equal(), and value_less().

struct value* value_subscript ( struct value array,
LONGEST  index 
) [read]
struct value* value_subscripted_rvalue ( struct value array,
LONGEST  index,
int  lowerbound 
) [read]
static struct value* value_user_defined_cpp_op ( struct value **  args,
int  nargs,
char *  operator,
int static_memfuncp 
) [static, read]

Definition at line 289 of file valarith.c.

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

Referenced by value_user_defined_op().

static struct value* value_user_defined_op ( struct value **  argp,
struct value **  args,
char *  name,
int static_memfuncp,
int  nargs 
) [static, read]
struct value* value_vector_widen ( struct value scalar_value,
struct type vector_type 
) [read]
struct value* value_x_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op,
enum exp_opcode  otherop,
enum noside noside   
) [read]
struct value* value_x_unop ( struct value arg1,
enum exp_opcode  op,
enum noside noside   
) [read]
static struct value* vector_binop ( struct value val1,
struct value val2,
enum exp_opcode  op 
) [static, read]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines