67 #define STRIP_REFERENCE(TYPE) \ 68 ((TYPE_CODE (TYPE) == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE)) 80 SCM result = SCM_BOOL_F;
81 struct value *res_val = NULL;
151 const char *func_name)
155 struct value *arg1, *arg2;
156 SCM result = SCM_BOOL_F;
157 struct value *res_val = NULL;
255 res_val =
value_binop (arg1, arg2, BINOP_BITWISE_AND);
258 res_val =
value_binop (arg1, arg2, BINOP_BITWISE_IOR);
261 res_val =
value_binop (arg1, arg2, BINOP_BITWISE_XOR);
444 struct value *v1, *v2;
503 return scm_from_bool (result);
560 static struct value *
562 int type_arg_pos, SCM type_scm,
struct type *
type,
573 if (!scm_is_unsigned_integer (obj, 0, max))
578 _(
"value out of range for type"));
588 if (!scm_is_signed_integer (obj, min, max))
593 _(
"value out of range for type"));
604 scm_to_double (obj));
628 return scm_is_unsigned_integer (obj, 0, max);
638 return scm_is_signed_integer (obj, min, max);
655 static struct value *
664 if (scm_is_exact (obj) && scm_is_integer (obj))
685 else if (scm_is_real (obj))
690 scm_to_double (obj));
695 _(
"value not a number representable on the target"));
710 static struct value *
712 int arg_pos,
const char *func_name,
715 LONGEST length = SCM_BYTEVECTOR_LENGTH (bv);
729 _(
"size of type does not match size of bytevector"));
734 (
gdb_byte *) SCM_BYTEVECTOR_CONTENTS (bv));
758 int obj_arg_pos, SCM obj,
759 int type_arg_pos, SCM type_scm,
766 SCM except_scm = SCM_BOOL_F;
774 *except_scmp = SCM_BOOL_F;
784 _(
"No type allowed"));
793 obj_arg_pos, func_name,
813 else if (scm_is_number (obj))
818 type_arg_pos, type_scm,
type,
827 else if (scm_is_string (obj))
837 _(
"No type allowed"));
866 _(
"No type allowed"));
892 *except_scmp = except_scm;
904 int obj_arg_pos, SCM obj,
909 -1, SCM_UNDEFINED, NULL,
940 Return a mod b. See Knuth 1.2.4." },
944 Return pow (x, y)." },
972 Return min (a, b)." },
976 Return max (a, b)." },
struct value * value_zero(struct type *type, enum lval_type lv)
static SCM gdbscm_value_rsh(SCM x, SCM y)
struct value * value_mark(void)
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
static struct value * vlscm_convert_bytevector(SCM bv, struct type *type, SCM type_scm, int arg_pos, const char *func_name, SCM *except_scmp, struct gdbarch *gdbarch)
static SCM gdbscm_value_pos(SCM x)
const char * target_charset(struct gdbarch *gdbarch)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
struct value * vlscm_convert_value_from_scheme(const char *func_name, int obj_arg_pos, SCM obj, SCM *except_scmp, struct gdbarch *gdbarch, const struct language_defn *language)
void gdbscm_define_functions(const scheme_function *, int is_public)
struct type * builtin_unsigned_int
static SCM gdbscm_value_not(SCM x)
struct value * value_from_contents(struct type *type, const gdb_byte *contents)
static SCM gdbscm_value_rem(SCM x, SCM y)
LONGEST value_as_long(struct value *val)
LONGEST value_ptrdiff(struct value *arg1, struct value *arg2)
struct type * language_string_char_type(const struct language_defn *la, struct gdbarch *gdbarch)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
struct type * builtin_uint8
static SCM gdbscm_value_min(SCM x, SCM y)
const struct gdb_exception exception_none
int vlscm_is_value(SCM scm)
SCM gdbscm_make_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
struct value * value_copy(struct value *arg)
void gdbscm_initialize_math(void)
struct value * lsscm_safe_lazy_string_to_value(SCM string, int arg_pos, const char *func_name, SCM *except_scmp)
#define gdbscm_is_bool(scm)
static SCM gdbscm_value_logxor(SCM x, SCM y)
SCM vlscm_scm_from_value(struct value *value)
static const scheme_function math_functions[]
int gdbscm_is_exception(SCM scm)
struct value * allocate_value(struct type *type)
SCM gdbscm_make_type_error(const char *subr, int arg_pos, SCM bad_value, const char *expected_type)
static struct value * vlscm_convert_number(const char *func_name, int obj_arg_pos, SCM obj, struct gdbarch *gdbarch, SCM *except_scmp)
#define gdbscm_is_true(scm)
static SCM gdbscm_value_pow(SCM x, SCM y)
static SCM gdbscm_value_abs(SCM x)
static SCM gdbscm_value_lsh(SCM x, SCM y)
struct value * value_ptradd(struct value *arg1, LONGEST arg2)
static SCM gdbscm_value_eq_p(SCM x, SCM y)
struct value * vlscm_convert_typed_value_from_scheme(const char *func_name, int obj_arg_pos, SCM obj, int type_arg_pos, SCM type_scm, struct type *type, SCM *except_scmp, struct gdbarch *gdbarch, const struct language_defn *language)
struct type * check_typedef(struct type *type)
#define CATCH(EXCEPTION, MASK)
struct type * builtin_unsigned_long
static SCM gdbscm_value_gt_p(SCM x, SCM y)
SCM gdbscm_scm_from_gdb_exception(struct gdb_exception exception)
struct cleanup * make_cleanup_value_free_to_mark(struct value *mark)
#define gdb_assert_not_reached(message)
int is_integral_type(struct type *t)
static SCM gdbscm_value_mod(SCM x, SCM y)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
void gdbscm_throw(SCM exception) ATTRIBUTE_NORETURN
struct gdbarch * get_current_arch(void)
void get_signed_type_minmax(struct type *type, LONGEST *min, LONGEST *max)
struct type * language_bool_type(const struct language_defn *la, struct gdbarch *gdbarch)
struct value * value_from_longest(struct type *type, LONGEST num)
struct type * builtin_long
int lsscm_is_lazy_string(SCM scm)
static SCM gdbscm_value_lt_p(SCM x, SCM y)
ULONGEST gdbscm_scm_to_ulongest(SCM u)
int value_equal(struct value *arg1, struct value *arg2)
static SCM vlscm_unop(enum valscm_unary_opcode opcode, SCM x, const char *func_name)
void get_unsigned_type_max(struct type *type, ULONGEST *max)
struct type * builtin_unsigned_long_long
static SCM gdbscm_value_le_p(SCM x, SCM y)
static SCM vlscm_binop(enum valscm_binary_opcode opcode, SCM x, SCM y, const char *func_name)
static SCM gdbscm_value_ge_p(SCM x, SCM y)
static SCM gdbscm_value_mul(SCM x, SCM y)
void target_float_from_host_double(gdb_byte *addr, const struct type *type, double val)
const struct language_defn * current_language
struct type * builtin_double
struct value * value_neg(struct value *arg1)
LONGEST gdbscm_scm_to_longest(SCM l)
#define TYPE_CODE(thistype)
static SCM gdbscm_value_logior(SCM x, SCM y)
static struct value * vlscm_convert_typed_number(const char *func_name, int obj_arg_pos, SCM obj, int type_arg_pos, SCM type_scm, struct type *type, struct gdbarch *gdbarch, SCM *except_scmp)
int value_less(struct value *arg1, struct value *arg2)
struct value * value_complement(struct value *arg1)
#define GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS(exception, cleanups)
static SCM gdbscm_value_add(SCM x, SCM y)
int value_logical_not(struct value *arg1)
struct value * value_binop(struct value *arg1, struct value *arg2, enum exp_opcode op)
static SCM gdbscm_value_neg(SCM x)
SCM gdbscm_make_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
static SCM gdbscm_value_max(SCM x, SCM y)
static SCM vlscm_rich_compare(int op, SCM x, SCM y, const char *func_name)
unsigned long long ULONGEST
struct type * builtin_long_long
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
struct type * value_type(const struct value *value)
struct value * vlscm_scm_to_value(SCM scm)
gdb_byte * value_contents_raw(struct value *value)
#define TYPE_LENGTH(thistype)
struct value * value_cstring(const char *ptr, ssize_t len, struct type *char_type)
#define STRIP_REFERENCE(TYPE)
static SCM gdbscm_value_lognot(SCM x)
SCM char * gdbscm_scm_to_string(SCM string, size_t *lenp, const char *charset, int strict, SCM *except_scmp)
void make_vector_type(struct type *array_type)
void do_cleanups(struct cleanup *old_chain)
static SCM gdbscm_value_div(SCM x, SCM y)
static SCM gdbscm_value_sub(SCM x, SCM y)
static int vlscm_integer_fits_p(SCM obj, struct type *type)
struct type * builtin_int
static SCM gdbscm_value_logand(SCM x, SCM y)