GDB (xrefs)
|
#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 value * | value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound) |
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) |
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 (gdb::array_view< value * > args, char *oper, int *static_memfuncp, enum noside noside) |
static struct value * | value_user_defined_op (struct value **argp, gdb::array_view< value * > args, char *name, int *static_memfuncp, 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 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 value * | fixed_point_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) |
static struct type * | promotion_type (struct type *type1, struct type *type2) |
static struct value * | scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) |
static struct value * | complex_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 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) |
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 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 41 of file valarith.c.
int binop_types_user_defined_p | ( | enum exp_opcode | op, |
struct type * | type1, | ||
struct type * | type2 | ||
) |
Definition at line 252 of file valarith.c.
References check_typedef(), type::code(), type::target_type(), and TYPE_IS_REFERENCE.
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 277 of file valarith.c.
References binop_types_user_defined_p(), and value_type().
Referenced by eval_binop_assign_modify(), eval_multi_subscript(), eval_op_add(), eval_op_binary(), eval_op_equal(), eval_op_geq(), eval_op_gtr(), eval_op_leq(), eval_op_less(), eval_op_notequal(), eval_op_sub(), eval_op_subscript(), expr::assign_operation::evaluate(), expr::logical_and_operation::evaluate(), expr::logical_or_operation::evaluate(), and valpy_binop_throw().
|
static |
Definition at line 1090 of file valarith.c.
References current_language, type::is_unsigned(), language_defn::la_language, language_go, and type_length_bits().
Referenced by scalar_binop().
|
static |
Definition at line 962 of file valarith.c.
References can_create_complex_type(), check_typedef(), type::code(), init_complex_type(), not_lval, promotion_type(), scalar_binop(), value_as_long(), value_cast(), value_complement(), value_from_longest(), value_imaginary_part(), value_literal_complex(), value_real_part(), value_type(), and value_zero().
Referenced by scalar_binop().
|
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().
|
static |
Definition at line 812 of file valarith.c.
References allocate_value(), type::arch(), check_typedef(), current_language, type::fixed_point_scaling_factor(), is_fixed_point_type(), type::is_unsigned(), language_bool_type(), gdb_mpq::read_fixed_point(), type_byte_order(), gdb_mpq::val, value_cast(), value_contents(), value_contents_raw(), value_from_ulongest(), value_to_gdb_mpq(), and value_type().
Referenced by scalar_binop().
|
static |
Definition at line 718 of file valarith.c.
Referenced by scalar_binop().
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().
|
static |
Definition at line 1138 of file valarith.c.
References allocate_value(), check_typedef(), check_valid_shift_count(), type::code(), coerce_ref(), complex_binop(), fixed_point_binop(), integer_pow(), is_fixed_point_type(), is_floating_type(), is_floating_value(), is_integral_type(), type::is_unsigned(), type::length(), promotion_type(), store_signed_integer(), store_unsigned_integer(), target_float_binop(), TRUNCATION_TOWARDS_ZERO, type_byte_order(), uinteger_pow(), value_args_as_target_float(), value_as_long(), value_contents_raw(), and value_type().
Referenced by complex_binop(), and value_binop().
|
static |
Definition at line 1074 of file valarith.c.
References type::arch(), gdbarch_addressable_memory_unit_size(), and type::length().
Referenced by check_valid_shift_count().
int unop_user_defined_p | ( | enum exp_opcode | op, |
struct value * | arg1 | ||
) |
Definition at line 290 of file valarith.c.
References check_typedef(), type::code(), type::target_type(), TYPE_IS_REFERENCE, and value_type().
Referenced by eval_op_complement(), eval_op_ind(), eval_op_lognot(), eval_op_neg(), eval_op_plus(), eval_op_postdec(), eval_op_postinc(), eval_op_predec(), eval_op_preinc(), eval_op_structop_ptr(), expr::unop_ind_base_operation::evaluate_for_address(), and expr::structop_base_operation::evaluate_funcall().
|
static |
Definition at line 748 of file valarith.c.
References check_typedef(), type::code(), is_floating_type(), is_integral_type(), type::is_unsigned(), type::length(), type::name(), target_float_from_longest(), target_float_from_ulongest(), value_as_long(), 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 1633 of file valarith.c.
References check_typedef(), type::code(), is_integral_type(), type::is_vector(), scalar_binop(), value_type(), value_vector_widen(), and vector_binop().
Referenced by ada_binop_exp(), ada_binop_minmax(), ada_value_binop(), eval_binop_assign_modify(), eval_op_add(), eval_op_binary(), eval_op_postdec(), eval_op_postinc(), eval_op_predec(), eval_op_preinc(), eval_op_sub(), expr::ada_binop_addsub_operation::evaluate(), dwarf_expr_context::execute_stack_op(), valpy_binop_throw(), value_equal(), value_less(), value_neg(), vector_binop(), and vlscm_binop_gdbthrow().
int value_bit_index | ( | struct type * | type, |
const gdb_byte * | valaddr, | ||
int | index | ||
) |
Definition at line 1988 of file valarith.c.
References type::arch(), extract_unsigned_integer(), gdbarch_byte_order(), get_discrete_bounds(), type::index_type(), and type_byte_order().
Referenced by m2_print_long_set(), value_in(), m2_language::value_print_inner(), and pascal_language::value_print_inner().
Definition at line 1937 of file valarith.c.
References allocate_value(), check_typedef(), type::code(), coerce_ref(), get_array_bounds(), is_integral_type(), type::is_vector(), type::length(), type::target_type(), value_as_long(), value_complement(), value_contents_all(), value_contents_writeable(), value_from_longest(), value_imaginary_part(), value_literal_complex(), value_neg(), value_real_part(), value_subscript(), and value_type().
Referenced by complex_binop(), eval_op_complement(), eval_op_rust_complement(), dwarf_expr_context::execute_stack_op(), valpy_invert(), value_complement(), and vlscm_unop_gdbthrow().
Definition at line 657 of file valarith.c.
References allocate_value(), language_defn::c_style_arrays_p(), check_typedef(), type::code(), value::contents, current_language, get_array_bounds(), lookup_array_range_type(), type::target_type(), types_equal(), value_contents(), value_contents_raw(), and value_type().
Referenced by expr::ada_concat_operation::evaluate(), and expr::concat_operation::evaluate().
Definition at line 1728 of file valarith.c.
References check_typedef(), type::code(), coerce_array(), is_floating_value(), is_integral_type(), type::length(), longest_to_int(), target_float_compare(), value_args_as_target_float(), value_as_address(), value_as_long(), value_binop(), value_contents(), value_strcmp(), and value_type().
Referenced by ada_binop_in_bounds(), ada_unop_in_range(), ada_value_equal(), eval_op_equal(), eval_op_geq(), eval_op_leq(), eval_op_notequal(), eval_ternop_in_range(), dwarf_expr_context::execute_stack_op(), gdbscm_value_to_real(), scalar_relop(), valpy_richcompare_throw(), value_vector_widen(), vlscm_equal_p_value_smob(), and vlscm_rich_compare().
Definition at line 1800 of file valarith.c.
References check_typedef(), type::code(), type::length(), value_contents(), and value_type().
Referenced by watchpoint_check().
Definition at line 2010 of file valarith.c.
References check_typedef(), type::code(), type::target_type(), value_as_long(), value_bit_index(), value_contents(), and value_type().
Definition at line 1818 of file valarith.c.
References check_typedef(), type::code(), coerce_array(), is_fixed_point_type(), is_floating_value(), is_integral_type(), type::length(), longest_to_int(), target_float_compare(), value_args_as_target_float(), value_as_address(), value_as_long(), value_binop(), value_strcmp(), and value_type().
Referenced by ada_abs(), ada_binop_in_bounds(), ada_unop_in_range(), eval_op_geq(), eval_op_gtr(), eval_op_leq(), eval_op_less(), eval_ternop_in_range(), dwarf_expr_context::execute_stack_op(), scalar_relop(), valpy_absolute(), valpy_richcompare_throw(), vlscm_rich_compare(), and vlscm_unop_gdbthrow().
bool value_logical_not | ( | struct value * | arg1 | ) |
Definition at line 1670 of file valarith.c.
References check_typedef(), coerce_array(), is_floating_value(), type::length(), target_float_is_zero(), value_contents(), and value_type().
Referenced by eval_op_binary(), eval_op_lognot(), eval_op_rust_complement(), expr::opencl_logical_binop_operation::evaluate(), expr::opencl_ternop_cond_operation::evaluate(), expr::ternop_cond_operation::evaluate(), expr::logical_and_operation::evaluate(), expr::logical_or_operation::evaluate(), opencl_logical_not(), scalar_relop(), value_allocate_space_in_inferior(), value_cast_pointers(), value_true(), and vlscm_unop_gdbthrow().
Definition at line 1891 of file valarith.c.
References allocate_value(), check_typedef(), type::code(), coerce_ref(), get_array_bounds(), is_fixed_point_type(), is_floating_type(), is_integral_type(), type::is_vector(), type::length(), not_lval, type::target_type(), value_binop(), value_contents_all(), value_contents_writeable(), value_from_longest(), value_imaginary_part(), value_literal_complex(), value_neg(), value_real_part(), value_subscript(), value_type(), and value_zero().
Referenced by ada_abs(), ada_unop_neg(), eval_op_neg(), dwarf_expr_context::execute_stack_op(), valpy_negative(), value_complement(), value_neg(), and vlscm_unop_gdbthrow().
Definition at line 1875 of file valarith.c.
References check_typedef(), type::code(), coerce_ref(), is_floating_value(), is_integral_type(), type::is_vector(), value_contents(), value_from_contents(), and value_type().
Referenced by eval_op_plus().
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(), eval_binop_assign_modify(), eval_op_add(), eval_op_m2_subscript(), eval_op_postdec(), eval_op_postinc(), eval_op_predec(), eval_op_preinc(), eval_op_sub(), ravenscar_thread_target::get_fpu_state(), gnuv2_virtual_fn_field(), gnuv3_method_ptr_to_value(), valpy_binop_throw(), value_subscript(), and vlscm_binop_gdbthrow().
Definition at line 105 of file valarith.c.
References check_typedef(), type::code(), coerce_array(), type::length(), type::target_type(), type_length_units(), value_as_long(), and value_type().
Referenced by eval_op_sub(), valpy_binop_throw(), and vlscm_binop_gdbthrow().
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().
Definition at line 146 of file valarith.c.
References language_defn::c_style_arrays_p(), check_typedef(), type::code(), coerce_ref(), current_language, get_discrete_high_bound(), get_discrete_low_bound(), type::index_type(), lval_memory, value_coerce_array(), value_ind(), VALUE_LVAL, value_ptradd(), value_subscripted_rvalue(), and value_type().
Referenced by ada_promote_array_of_integrals(), ada_value_subscript(), c_describe_child(), create_value(), eval_multi_subscript(), eval_op_m2_subscript(), eval_op_subscript(), expr::opencl_ternop_cond_operation::evaluate(), 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(), rust_subscript(), valpy_getitem(), value_complement(), value_neg(), vector_binop(), and vector_relop().
|
static |
Definition at line 199 of file valarith.c.
References type::arch(), type::bit_stride(), type::bounds(), check_typedef(), gdbarch_addressable_memory_unit_size(), range_bounds::high, is_dynamic_type(), dynamic_prop::kind(), lval_memory, PROP_UNDEFINED, resolve_dynamic_type(), type::target_type(), type_length_units(), type_not_allocated(), type_not_associated(), value_address(), value_from_component(), VALUE_LVAL, and value_type().
Referenced by value_subscript().
|
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().
|
static |
Definition at line 342 of file valarith.c.
References current_language, language_defn::la_language, language_cplus, name, value_struct_elt(), and value_user_defined_cpp_op().
Referenced by value_x_binop(), and value_x_unop().
Definition at line 1542 of file valarith.c.
References allocate_value(), check_typedef(), type::code(), get_array_bounds(), type::is_vector(), type::length(), type::target_type(), 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 noside | |||
) |
Definition at line 369 of file valarith.c.
References call_function_by_hand(), call_xmethod(), check_typedef(), code, coerce_ref(), EVAL_AVOID_SIDE_EFFECTS, result_type_of_xmethod(), type::target_type(), value_addr(), VALUE_LVAL, value_type(), value_user_defined_op(), and value_zero().
Referenced by eval_binop_assign_modify(), eval_multi_subscript(), eval_op_add(), eval_op_binary(), eval_op_equal(), eval_op_geq(), eval_op_gtr(), eval_op_leq(), eval_op_less(), eval_op_notequal(), eval_op_sub(), eval_op_subscript(), expr::assign_operation::evaluate(), expr::logical_and_operation::evaluate(), expr::logical_or_operation::evaluate(), and valpy_binop_throw().
Definition at line 545 of file valarith.c.
References type::arch(), call_function_by_hand(), call_xmethod(), check_typedef(), code, coerce_ref(), EVAL_AVOID_SIDE_EFFECTS, result_type_of_xmethod(), type::target_type(), value_addr(), value_from_longest(), VALUE_LVAL, value_type(), value_user_defined_op(), and value_zero().
Referenced by eval_op_complement(), eval_op_ind(), eval_op_lognot(), eval_op_neg(), eval_op_plus(), eval_op_postdec(), eval_op_postinc(), eval_op_predec(), eval_op_preinc(), eval_op_structop_ptr(), expr::unop_ind_base_operation::evaluate_for_address(), and expr::structop_base_operation::evaluate_funcall().
|
static |
Definition at line 1585 of file valarith.c.
References allocate_value(), check_typedef(), type::code(), get_array_bounds(), type::is_unsigned(), type::is_vector(), type::length(), type::target_type(), value_binop(), value_contents_all(), value_contents_writeable(), value_subscript(), and value_type().
Referenced by value_binop().