GDB (xrefs)
Macros | Functions
/tmp/gdb-7.10/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 "doublest.h"
#include "dfp.h"
#include <math.h>
#include "infcall.h"

Go to the source code of this file.

Macros

#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 *oper, int *static_memfuncp, enum noside noside)
 
static struct valuevalue_user_defined_op (struct value **argp, struct value **args, char *name, int *static_memfuncp, int nargs, 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 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)
 

Macro Definition Documentation

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

Definition at line 36 of file valarith.c.

Referenced by scalar_binop().

Function Documentation

void _initialize_valarith ( void  )

Definition at line 1906 of file valarith.c.

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 253 of file valarith.c.

References binop_types_user_defined_p(), and value_type().

Referenced by evaluate_subexp_standard(), and valpy_binop().

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

Definition at line 800 of file valarith.c.

References _, error(), and L.

Referenced by scalar_binop().

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

Definition at line 831 of file valarith.c.

References _, error(), and L.

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 
)
int value_bit_index ( struct type type,
const gdb_byte valaddr,
int  index 
)
struct value* value_complement ( struct value arg1)
struct value* value_concat ( 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 
)

Definition at line 1656 of file valarith.c.

References check_typedef(), 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)
struct value* value_pos ( struct value arg1)
struct value* value_ptradd ( struct value arg1,
LONGEST  arg2 
)
LONGEST value_ptrdiff ( struct value arg1,
struct value arg2 
)
static int value_strcmp ( struct value arg1,
struct value arg2 
)
static

Definition at line 1544 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 
)
struct value* value_subscripted_rvalue ( struct value array,
LONGEST  index,
int  lowerbound 
)
static struct value* value_user_defined_cpp_op ( struct value **  args,
int  nargs,
char *  oper,
int static_memfuncp,
enum noside  noside 
)
static

Definition at line 287 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,
enum noside  noside 
)
static
struct value* value_vector_widen ( struct value scalar_value,
struct type vector_type 
)
struct value* value_x_binop ( struct value arg1,
struct value arg2,
enum exp_opcode  op,
enum exp_opcode  otherop,
enum noside noside   
)
struct value* value_x_unop ( struct value arg1,
enum exp_opcode  op,
enum noside noside   
)
static struct value* vector_binop ( struct value val1,
struct value val2,
enum exp_opcode  op 
)
static