97 scm_remember_upto_here_1 (self);
111 const char *encoding,
struct type *
type)
117 gdb_assert (length >= -1);
118 gdb_assert (!(address == 0 && length != 0));
119 gdb_assert (
type != NULL);
123 if (encoding == NULL || strcmp (encoding,
"") == 0)
126 ls_smob->
encoding = xstrdup (encoding);
156 const char *encoding,
struct type *
type)
161 scm_from_int (length),
162 _(
"invalid length"));
165 if (address == 0 && length != 0)
168 (NULL, 0, scm_from_int (length),
169 _(
"cannot create a lazy string with address 0x0,"
170 " and a non-zero length"));
176 (NULL, 0, scm_from_int (0), _(
"a lazy string's type cannot be NULL"));
200 struct type *realtype;
204 switch (realtype->
code ())
207 case TYPE_CODE_ARRAY:
237 return scm_from_int (ls_smob->
length);
263 return ls_smob->
type;
295 const char *func_name, SCM *except_scmp)
308 _(
"cannot create a value from NULL"));
317 switch (realtype->
code ())
322 if (ls_smob->
length != -1)
339 catch (
const gdb_exception &except)
356 struct type *elt_type;
374Return #t if the object is a <gdb:lazy-string> object." },
376 {
"lazy-string-address", 1, 0, 0,
379Return the address of the lazy-string." },
383Return the length of the lazy-string.\n\
384If the length is -1 then the length is determined by the first null\n\
385of appropriate width." },
387 {
"lazy-string-encoding", 1, 0, 0,
390Return the encoding of the lazy-string." },
394Return the <gdb:type> of the lazy-string." },
396 {
"lazy-string->value", 1, 0, 0,
399Return the <gdb:value> representation of the lazy-string." },
static struct parser_state * pstate
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
struct type * check_typedef(struct type *type)
SCM gdbscm_make_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
gdbscm_gdb_exception unpack(const gdb_exception &exc)
void gdbscm_init_gsmob(gdb_smob *base)
SCM vlscm_scm_from_value(struct value *value)
SCM gdbscm_scm_from_gdb_exception(const gdbscm_gdb_exception &exception)
SCM tyscm_scm_from_type(struct type *type)
SCM gdbscm_scm_from_ulongest(ULONGEST l)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
struct type * tyscm_scm_to_type(SCM t_scm)
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
void gdbscm_define_functions(const scheme_function *, int is_public)
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
void gdbscm_throw(SCM exception) ATTRIBUTE_NORETURN
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
SCM gdbscm_scm_from_c_string(const char *string)
static SCM lsscm_get_lazy_string_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM lsscm_make_lazy_string_smob(CORE_ADDR address, int length, const char *encoding, struct type *type)
static const scheme_function lazy_string_functions[]
void lsscm_val_print_lazy_string(SCM string, struct ui_file *stream, const struct value_print_options *options)
static SCM gdbscm_lazy_string_type(SCM self)
static const char lazy_string_smob_name[]
SCM lsscm_make_lazy_string(CORE_ADDR address, int length, const char *encoding, struct type *type)
static struct type * lsscm_elt_type(lazy_string_smob *ls_smob)
static SCM gdbscm_lazy_string_address(SCM self)
int lsscm_is_lazy_string(SCM scm)
static SCM gdbscm_lazy_string_length(SCM self)
static int lsscm_print_lazy_string_smob(SCM self, SCM port, scm_print_state *pstate)
static SCM gdbscm_lazy_string_p(SCM scm)
static size_t lsscm_free_lazy_string_smob(SCM self)
void gdbscm_initialize_lazy_strings(void)
static scm_t_bits lazy_string_smob_tag
static SCM gdbscm_lazy_string_encoding(SCM self)
struct value * lsscm_safe_lazy_string_to_value(SCM string, int arg_pos, const char *func_name, SCM *except_scmp)
static SCM gdbscm_lazy_string_to_value(SCM self)
struct type * target_type() const
struct value * value_at_lazy(struct type *type, CORE_ADDR addr, frame_info_ptr frame)
int val_print_string(struct type *elttype, const char *encoding, CORE_ADDR addr, int len, struct ui_file *stream, const struct value_print_options *options)
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)