GDB (xrefs)
|
#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 value * | value_ptradd (struct value *arg1, LONGEST arg2) |
LONGEST | value_ptrdiff (struct value *arg1, struct value *arg2) |
struct value * | value_subscript (struct value *array, LONGEST index) |
struct value * | value_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 value * | value_user_defined_cpp_op (struct value **args, int nargs, char *oper, int *static_memfuncp, enum noside noside) |
static struct value * | value_user_defined_op (struct value **argp, struct value **args, char *name, int *static_memfuncp, int nargs, enum noside noside) |
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) |
struct value * | value_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 value * | scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) |
struct value * | value_vector_widen (struct value *scalar_value, struct type *vector_type) |
static struct value * | vector_binop (struct value *val1, struct value *val2, enum exp_opcode op) |
struct value * | value_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 value * | value_pos (struct value *arg1) |
struct value * | value_neg (struct value *arg1) |
struct value * | value_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 TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2) |
Definition at line 36 of file valarith.c.
Referenced by scalar_binop().
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 | ||
) |
Definition at line 228 of file valarith.c.
References check_typedef(), TYPE_CODE, TYPE_CODE_REF, TYPE_CODE_STRUCT, and TYPE_TARGET_TYPE.
Referenced by binop_user_defined_p(), and gen_expr_binop_rest().
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().
Definition at line 49 of file valarith.c.
References _, check_typedef(), error(), gdb_assert, name, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_VOID, TYPE_LENGTH, TYPE_NAME, TYPE_TAG_NAME, and TYPE_TARGET_TYPE.
Referenced by value_ptradd().
Definition at line 800 of file valarith.c.
Referenced by scalar_binop().
|
static |
Definition at line 928 of file valarith.c.
References _, allocate_value(), check_typedef(), coerce_ref(), decimal_binop(), error(), gdbarch_byte_order(), get_type_arch(), integer_pow(), is_integral_type(), safe_strerror(), store_signed_integer(), store_typed_floating(), store_unsigned_integer(), TRUNCATION_TOWARDS_ZERO, TYPE_CODE, TYPE_CODE_BOOL, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_LENGTH, TYPE_UNSIGNED, uinteger_pow(), value_args_as_decimal(), value_as_double(), value_as_long(), value_contents_raw(), value_from_decfloat(), and value_type().
Referenced by value_binop().
Definition at line 831 of file valarith.c.
Referenced by scalar_binop().
int unop_user_defined_p | ( | enum exp_opcode | op, |
struct value * | arg1 | ||
) |
Definition at line 266 of file valarith.c.
References check_typedef(), TYPE_CODE, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_TARGET_TYPE, and value_type().
Referenced by evaluate_subexp_for_address(), and evaluate_subexp_standard().
|
static |
Definition at line 861 of file valarith.c.
References _, check_typedef(), decimal_from_integral(), error(), gdb_assert, gdbarch_byte_order(), get_type_arch(), is_integral_type(), TYPE_CODE, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_LENGTH, TYPE_NAME, value_contents(), and value_type().
Referenced by scalar_binop(), value_equal(), and value_less().
struct value* value_binop | ( | struct value * | arg1, |
struct value * | arg2, | ||
enum exp_opcode | op | ||
) |
Definition at line 1476 of file valarith.c.
References _, check_typedef(), error(), is_integral_type(), scalar_binop(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_VECTOR, value_type(), value_vector_widen(), and vector_binop().
Referenced by ada_evaluate_subexp(), ada_value_binop(), evaluate_subexp_standard(), execute_stack_op(), valpy_binop(), value_equal(), value_less(), vector_binop(), and vlscm_binop().
Definition at line 1861 of file valarith.c.
References extract_unsigned_integer(), gdbarch_bits_big_endian(), gdbarch_byte_order(), get_discrete_bounds(), get_type_arch(), TARGET_CHAR_BIT, TYPE_INDEX_TYPE, and word.
Referenced by m2_print_long_set(), m2_val_print(), pascal_val_print(), and value_in().
Definition at line 1822 of file valarith.c.
References _, allocate_value(), check_typedef(), coerce_ref(), error(), get_array_bounds(), is_integral_type(), type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_VECTOR, value_as_long(), value_complement(), value_contents_all(), value_contents_writeable(), value_from_longest(), value_subscript(), and value_type().
Referenced by evaluate_subexp_standard(), execute_stack_op(), valpy_invert(), value_complement(), and vlscm_unop().
Definition at line 657 of file valarith.c.
References _, check_typedef(), do_cleanups(), error(), longest_to_int(), make_cleanup(), TYPE_CODE, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_INT, TYPE_CODE_STRING, TYPE_LENGTH, TYPE_TARGET_TYPE, unpack_long(), value_as_long(), value_contents(), value_string(), value_type(), xfree(), and xmalloc().
Referenced by evaluate_subexp_standard().
Definition at line 1574 of file valarith.c.
References _, check_typedef(), coerce_array(), decimal_compare(), error(), is_integral_type(), len, longest_to_int(), TYPE_CODE, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_CODE_PTR, TYPE_CODE_STRING, TYPE_LENGTH, value_args_as_decimal(), value_as_address(), value_as_double(), value_as_long(), value_binop(), value_contents(), value_strcmp(), and value_type().
Referenced by ada_evaluate_subexp(), ada_value_equal(), evaluate_subexp_standard(), execute_stack_op(), scalar_relop(), valpy_richcompare(), value_vector_widen(), vlscm_equal_p_value_smob(), and vlscm_rich_compare().
Definition at line 1656 of file valarith.c.
References check_typedef(), TYPE_CODE, TYPE_LENGTH, value_contents(), and value_type().
Referenced by watchpoint_check().
Definition at line 1883 of file valarith.c.
References _, check_typedef(), error(), TYPE_CODE, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_ENUM, TYPE_CODE_INT, TYPE_CODE_RANGE, TYPE_CODE_SET, TYPE_TARGET_TYPE, value_as_long(), value_bit_index(), value_contents(), and value_type().
Definition at line 1673 of file valarith.c.
References _, check_typedef(), coerce_array(), decimal_compare(), error(), is_integral_type(), longest_to_int(), TYPE_CODE, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_CODE_PTR, TYPE_CODE_STRING, value_args_as_decimal(), value_as_address(), value_as_double(), value_as_long(), value_binop(), value_strcmp(), and value_type().
Referenced by ada_evaluate_subexp(), evaluate_subexp_standard(), execute_stack_op(), scalar_relop(), valpy_absolute(), valpy_richcompare(), vlscm_rich_compare(), and vlscm_unop().
Definition at line 1513 of file valarith.c.
References check_typedef(), coerce_array(), decimal_is_zero(), gdbarch_byte_order(), get_type_arch(), len, TYPE_CODE, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_LENGTH, value_as_double(), value_contents(), and value_type().
Referenced by evaluate_subexp_opencl(), evaluate_subexp_standard(), java_value_print(), opencl_logical_not(), scalar_relop(), type_from_class(), value_allocate_space_in_inferior(), value_cast_pointers(), value_true(), and vlscm_unop().
Definition at line 1767 of file valarith.c.
References _, allocate_value(), check_typedef(), coerce_ref(), error(), gdbarch_byte_order(), get_array_bounds(), get_type_arch(), is_integral_type(), len, type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_VECTOR, value_as_double(), value_as_long(), value_contents(), value_contents_all(), value_contents_raw(), value_contents_writeable(), value_from_double(), value_from_longest(), value_neg(), value_subscript(), and value_type().
Referenced by ada_evaluate_subexp(), const_expr(), evaluate_subexp_standard(), execute_stack_op(), valpy_negative(), value_neg(), and vlscm_unop().
Definition at line 1736 of file valarith.c.
References _, allocate_value(), check_typedef(), coerce_ref(), error(), is_integral_type(), type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_LENGTH, TYPE_VECTOR, value_as_double(), value_as_long(), value_contents(), value_contents_raw(), value_from_decfloat(), value_from_double(), value_from_longest(), and value_type().
Referenced by evaluate_subexp_standard().
Definition at line 84 of file valarith.c.
References check_typedef(), coerce_array(), find_size_for_pointer_math(), lval_internalvar, set_value_component_location(), value_as_address(), value_from_pointer(), VALUE_LVAL, and value_type().
Referenced by ada_get_tsd_from_tag(), ada_tag_value_at_base_address(), ada_value_ptr_subscript(), evaluate_subexp_modula2(), evaluate_subexp_standard(), gnuv2_virtual_fn_field(), gnuv3_method_ptr_to_value(), valpy_binop(), value_subscript(), and vlscm_binop().
Definition at line 105 of file valarith.c.
References _, check_typedef(), coerce_array(), error(), gdb_assert, TYPE_CODE, TYPE_CODE_PTR, TYPE_LENGTH, TYPE_TARGET_TYPE, value_as_long(), value_type(), and warning().
Referenced by evaluate_subexp_standard(), valpy_binop(), and vlscm_binop().
Definition at line 1544 of file valarith.c.
References len, TYPE_LENGTH, value_contents(), and value_type().
Referenced by value_equal(), and value_less().
Definition at line 146 of file valarith.c.
References _, language_defn::c_style_arrays, check_typedef(), coerce_ref(), current_language, error(), get_discrete_bounds(), lval_memory, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_STRING, TYPE_INDEX_TYPE, value_coerce_array(), value_ind(), VALUE_LVAL, value_ptradd(), value_subscripted_rvalue(), value_type(), and warning().
Referenced by ada_promote_array_of_integrals(), ada_value_subscript(), c_describe_child(), create_value(), evaluate_subexp_java(), evaluate_subexp_modula2(), evaluate_subexp_opencl(), evaluate_subexp_standard(), gdbscm_value_subscript(), gnuv2_virtual_fn_field(), gnuv3_baseclass_offset(), gnuv3_get_virtual_fn(), lval_func_write(), opencl_logical_not(), print_one_vtable(), read_atcb(), valpy_getitem(), value_complement(), value_neg(), vector_binop(), and vector_relop().
Definition at line 191 of file valarith.c.
References _, allocate_value(), allocate_value_lazy(), check_typedef(), error(), longest_to_int(), lval_memory, set_value_component_location(), set_value_offset(), TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED, TYPE_LENGTH, TYPE_TARGET_TYPE, value_contents_copy(), value_embedded_offset(), VALUE_FRAME_ID, value_lazy(), VALUE_LVAL, value_offset(), VALUE_REGNUM, and value_type().
Referenced by evaluate_subexp_standard(), and value_subscript().
|
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 |
Definition at line 318 of file valarith.c.
References current_language, language_defn::la_language, language_cplus, value_struct_elt(), and value_user_defined_cpp_op().
Referenced by value_x_binop(), and value_x_unop().
Definition at line 1386 of file valarith.c.
References _, allocate_value(), CHECK_TYPEDEF, check_typedef(), error(), gdb_assert, get_array_bounds(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_VECTOR, value_cast(), value_contents_all(), value_contents_writeable(), value_equal(), and value_type().
Referenced by opencl_value_cast(), and value_binop().
struct value* value_x_binop | ( | struct value * | arg1, |
struct value * | arg2, | ||
enum exp_opcode | op, | ||
enum exp_opcode | otherop, | ||
enum noside noside | |||
) |
Definition at line 345 of file valarith.c.
References _, call_function_by_hand(), call_xmethod(), check_typedef(), coerce_ref(), error(), EVAL_AVOID_SIDE_EFFECTS, gdb_assert, NOT_FOUND_ERROR, result_type_of_xmethod(), throw_error(), TYPE_CODE, TYPE_CODE_STRUCT, TYPE_CODE_XMETHOD, TYPE_TARGET_TYPE, value_addr(), VALUE_LVAL, value_type(), value_user_defined_op(), and value_zero().
Referenced by evaluate_subexp_standard(), and valpy_binop().
struct value* value_x_unop | ( | struct value * | arg1, |
enum exp_opcode | op, | ||
enum noside noside | |||
) |
Definition at line 525 of file valarith.c.
References _, call_function_by_hand(), call_xmethod(), check_typedef(), coerce_ref(), error(), EVAL_AVOID_SIDE_EFFECTS, gdb_assert, get_type_arch(), NOT_FOUND_ERROR, result_type_of_xmethod(), throw_error(), TYPE_CODE, TYPE_CODE_STRUCT, TYPE_CODE_XMETHOD, TYPE_TARGET_TYPE, value_addr(), value_from_longest(), VALUE_LVAL, value_type(), value_user_defined_op(), and value_zero().
Referenced by evaluate_subexp_for_address(), and evaluate_subexp_standard().
|
static |
Definition at line 1426 of file valarith.c.
References _, allocate_value(), check_typedef(), error(), get_array_bounds(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_UNSIGNED, TYPE_VECTOR, value_binop(), value_contents_all(), value_contents_writeable(), value_free_to_mark(), value_mark(), value_subscript(), and value_type().
Referenced by value_binop().