69 #define STRIP_REFERENCE(TYPE) \
70 ((TYPE_CODE (TYPE) == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))
82 SCM result = SCM_BOOL_F;
83 struct value *res_val = NULL;
90 &except_scm, gdbarch, language);
153 const char *func_name)
157 struct value *arg1, *arg2;
158 SCM result = SCM_BOOL_F;
159 struct value *res_val = NULL;
166 &except_scm, gdbarch, language);
173 &except_scm, gdbarch, language);
257 res_val =
value_binop (arg1, arg2, BINOP_BITWISE_AND);
260 res_val =
value_binop (arg1, arg2, BINOP_BITWISE_IOR);
263 res_val =
value_binop (arg1, arg2, BINOP_BITWISE_XOR);
446 struct value *v1, *v2;
455 &except_scm, gdbarch, language);
462 &except_scm, gdbarch, language);
505 return scm_from_bool (result);
562 static struct value *
564 int type_arg_pos, SCM type_scm,
struct type *
type,
575 if (!scm_is_unsigned_integer (obj, 0, max))
580 _(
"value out of range for type"));
590 if (!scm_is_signed_integer (obj, min, max))
595 _(
"value out of range for type"));
624 return scm_is_unsigned_integer (obj, 0, max);
634 return scm_is_signed_integer (obj, min, max);
651 static struct value *
660 if (scm_is_exact (obj) && scm_is_integer (obj))
681 else if (scm_is_real (obj))
685 _(
"value not a number representable on the target"));
700 static struct value *
702 int arg_pos,
const char *func_name,
705 LONGEST length = SCM_BYTEVECTOR_LENGTH (bv);
719 _(
"size of type does not match size of bytevector"));
724 (
gdb_byte *) SCM_BYTEVECTOR_CONTENTS (bv));
748 int obj_arg_pos, SCM obj,
749 int type_arg_pos, SCM type_scm,
756 SCM except_scm = SCM_BOOL_F;
764 *except_scmp = SCM_BOOL_F;
774 _(
"No type allowed"));
783 obj_arg_pos, func_name,
784 &except_scm, gdbarch);
803 else if (scm_is_number (obj))
808 type_arg_pos, type_scm, type,
809 gdbarch, &except_scm);
814 gdbarch, &except_scm);
817 else if (scm_is_string (obj))
827 _(
"No type allowed"));
856 _(
"No type allowed"));
882 *except_scmp = except_scm;
894 int obj_arg_pos, SCM obj,
899 -1, SCM_UNDEFINED, NULL,
930 Return a mod b. See Knuth 1.2.4." },
934 Return pow (x, y)." },
962 Return min (a, b)." },
966 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 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)
int gdbscm_is_exception(SCM scm)
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)
struct value * value_from_double(struct type *type, DOUBLEST num)
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)
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)
struct value * value_cstring(char *ptr, ssize_t len, struct type *char_type)
#define GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS(exception, cleanups)
#define CHECK_TYPEDEF(TYPE)
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)
#define TYPE_LENGTH(thistype)
#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
const ULONGEST const LONGEST len
static SCM gdbscm_value_logand(SCM x, SCM y)