47 switch (str_type & ~
C_CHAR)
96 if (!strcmp (name,
"wchar_t"))
102 if (!strcmp (name,
"char16_t"))
108 if (!strcmp (name,
"char32_t"))
147 struct ui_file *stream,
int quoter)
190 const gdb_byte *
string,
unsigned int length,
191 const char *user_encoding,
int force_ellipses,
195 const char *type_encoding;
215 encoding = (user_encoding && *user_encoding) ? user_encoding : type_encoding;
240 int *length,
struct type **char_type,
241 const char **charset)
244 unsigned int fetchlimit;
248 enum bfd_endian byte_order
251 if (element_type == NULL)
264 &low_bound, &high_bound);
265 fetchlimit = high_bound - low_bound + 1;
297 for (i = 0; i < fetchlimit; i++)
299 width, byte_order) == 0)
306 memcpy (*buffer, contents, *length);
328 err =
read_string (addr, *length, width, fetchlimit,
329 byte_order, buffer, length);
341 if (req_length == -1)
345 width, byte_order) == 0)
352 *length = *length / width;
354 *char_type = element_type;
366 error (
_(
"Trying to read string with inappropriate type `%s'."),
370 error (
_(
"Trying to read string with inappropriate type."));
385 struct obstack *output,
int length)
387 unsigned long result = 0;
391 for (i = 0; i < length && p < limit && isxdigit (*p); ++i, ++p)
394 for (i = 3; i >= 0; --i)
396 data[i] = result & 0xff;
411 struct obstack *output)
427 char *limit,
struct obstack *output)
430 unsigned long value = 0;
433 i < 3 && p < limit && isdigit (*p) && *p !=
'8' && *p !=
'9';
452 char *limit,
struct obstack *output)
454 unsigned long value = 0;
456 while (p < limit && isxdigit (*p))
471 error (_("Malformed escape sequence")); \
483 char *p,
char *limit,
struct obstack *output)
491 obstack_1grow (output,
'\\');
498 error (
_(
"\\x used with no following hex digits."));
516 int length = *p ==
'u' ? 4 : 8;
520 error (
_(
"\\u used with no following hex digits"));
521 p =
convert_ucn (p, limit, dest_charset, output, length);
536 const char *dest_charset,
struct type *
type)
547 while (p < limit && *p !=
'\\')
577 struct obstack output;
579 struct value *result;
581 const char *dest_charset;
582 int satisfy_expected = 0;
584 obstack_init (&output);
594 switch (dest_type & ~
C_CHAR)
606 "char16_t", NULL, 0);
610 "char32_t", NULL, 0);
624 struct type *element_type
631 satisfy_expected = 1;
657 if (expect_type != NULL)
659 else if ((dest_type &
C_CHAR) != 0)
667 if ((dest_type &
C_CHAR) != 0)
671 if (obstack_object_size (&output) !=
TYPE_LENGTH (type))
672 error (
_(
"Could not convert character "
673 "constant to target character set"));
683 obstack_1grow (&output, 0);
685 if (satisfy_expected)
691 &low_bound, &high_bound) < 0)
694 high_bound = (
TYPE_LENGTH (expect_type) / element_size) - 1;
696 if (obstack_object_size (&output) / element_size
697 > (high_bound - low_bound + 1))
698 error (
_(
"Too many array elements"));
702 obstack_object_size (&output));
706 obstack_object_size (&output),
860 default_make_symbol_completion_list,
987 default_make_symbol_completion_list,
1032 default_make_symbol_completion_list,
1082 default_make_symbol_completion_list,
struct type * cp_lookup_transparent_type(const char *name)
union exp_element elts[1]
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
const struct op_print c_op_print_tab[]
struct type * builtin_declong
const char * target_charset(struct gdbarch *gdbarch)
static char * convert_ucn(char *p, char *limit, const char *dest_charset, struct obstack *output, int length)
struct value * evaluate_subexp_c(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
struct type * builtin_long_double
struct type * builtin_unsigned_int
struct type * builtin_double_complex
#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE)
int fputc_filtered(int c, struct ui_file *stream)
int cp_pass_by_reference(struct type *type)
#define TYPE_NAME(thistype)
struct type * language_string_char_type(const struct language_defn *la, struct gdbarch *gdbarch)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
void internal_error(const char *file, int line, const char *fmt,...)
const struct language_defn * language_defn
void c_val_print(struct type *, const gdb_byte *, int, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *)
void c_language_arch_info(struct gdbarch *gdbarch, struct language_arch_info *lai)
struct value * default_read_var_value(struct symbol *var, struct frame_info *frame)
char * c_compute_program(struct compile_instance *inst, const char *input, struct gdbarch *gdbarch, const struct block *expr_block, CORE_ADDR expr_pc)
static void emit_numeric_character(struct type *type, unsigned long value, struct obstack *output)
static char * convert_hex(struct type *type, char *p, char *limit, struct obstack *output)
struct type * string_char_type
struct type * builtin_complex
#define BYTES_TO_EXP_ELEM(bytes)
#define TYPE_FIELD_TYPE(thistype, n)
const struct lang_varobj_ops c_varobj_ops
struct value * allocate_value(struct type *type)
void add_language(const struct language_defn *lang)
void c_get_string(struct value *value, gdb_byte **buffer, int *length, struct type **char_type, const char **charset)
struct type * builtin_short
int longest_to_int(LONGEST)
void memory_error(enum target_xfer_status err, CORE_ADDR memaddr)
struct type * lookup_typename(const struct language_defn *language, struct gdbarch *gdbarch, const char *name, const struct block *block, int noerr)
char * gdb_demangle(const char *name, int options)
char * default_word_break_characters(void)
#define LA_EMIT_CHAR(ch, type, stream, quoter)
struct type * builtin_decdouble
struct type * check_typedef(struct type *type)
const gdb_byte * value_contents(struct value *value)
void convert_between_encodings(const char *from, const char *to, const gdb_byte *bytes, unsigned int num_bytes, int width, struct obstack *output, enum transliterations translit)
void generic_printstr(struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options)
const struct exp_descriptor exp_descriptor_c
struct type * builtin_unsigned_long
struct type * bool_type_default
void null_post_parser(struct expression **exp, int void_context_p)
void c_emit_char(int c, struct type *type, struct ui_file *stream, int quoter)
const char * target_wide_charset(struct gdbarch *gdbarch)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t err
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
const char * bool_type_symbol
static const char * charset_for_string_type(enum c_string_type str_type, struct gdbarch *gdbarch)
int default_pass_by_reference(struct type *type)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
struct type * basic_lookup_transparent_type(const char *name)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct gdbarch * get_type_arch(const struct type *type)
int host_hex_value(char c)
int dump_subexp_body_standard(struct expression *exp, struct ui_file *stream, int elt)
struct value * value_from_longest(struct type *type, LONGEST num)
struct type * builtin_decfloat
void iterate_over_symbols(const struct block *block, const char *name, const domain_enum domain, symbol_found_callback_ftype *callback, void *data)
struct type * builtin_long
const struct lang_varobj_ops cplus_varobj_ops
void _initialize_c_language(void)
void default_print_array_index(struct value *index_value, struct ui_file *stream, const struct value_print_options *options)
struct type * builtin_unsigned_char
char * op_name_standard(enum exp_opcode opcode)
void c_print_typedef(struct type *, struct symbol *, struct ui_file *)
struct type * builtin_bool
struct type * builtin_unsigned_long_long
LONGEST unpack_long(struct type *type, const gdb_byte *valaddr)
struct type * builtin_signed_char
int c_parse(struct parser_state *par_state)
static enum c_string_type classify_type(struct type *elttype, struct gdbarch *gdbarch, const char **encoding)
struct type * builtin_unsigned_short
static void cplus_language_arch_info(struct gdbarch *gdbarch, struct language_arch_info *lai)
void c_printstr(struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *user_encoding, int force_ellipses, const struct value_print_options *options)
static char * convert_escape(struct type *type, const char *dest_charset, char *p, char *limit, struct obstack *output)
char * cp_class_name_from_physname(const char *physname)
struct compile_instance * c_get_compile_context(void)
int read_string(CORE_ADDR addr, int len, int width, unsigned int fetchlimit, enum bfd_endian byte_order, gdb_byte **buffer, int *bytes_read)
struct type * builtin_char
#define TYPE_TARGET_TYPE(thistype)
struct type * builtin_double
void print_subexp_standard(struct expression *exp, int *pos, struct ui_file *stream, enum precedence prec)
#define TYPE_CODE(thistype)
#define TYPE_INDEX_TYPE(type)
#define default_varobj_ops
void c_print_type(struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *)
int operator_check_standard(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
#define TYPE_NFIELDS(thistype)
void generic_emit_char(int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding)
struct value * value_cstring(char *ptr, ssize_t len, struct type *char_type)
struct symbol * cp_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
#define CHECK_TYPEDEF(TYPE)
struct value * evaluate_subexp_standard(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
int c_textual_element_type(struct type *, char)
void operator_length_standard(const struct expression *expr, int endpos, int *oplenp, int *argsp)
static char * convert_octal(struct type *type, char *p, char *limit, struct obstack *output)
struct type * builtin_long_long
struct symbol * basic_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
struct type * value_type(const struct value *value)
void c_printchar(int c, struct type *type, struct ui_file *stream)
CORE_ADDR value_as_address(struct value *val)
static void parse_one_string(struct obstack *output, char *data, int len, const char *dest_charset, struct type *type)
const char * host_charset(void)
gdb_byte * value_contents_raw(struct value *value)
#define TYPE_LENGTH(thistype)
struct cleanup * make_cleanup_obstack_free(struct obstack *obstack)
char * type_to_string(struct type *type)
struct type ** primitive_type_vector
void pack_long(gdb_byte *buf, struct type *type, LONGEST num)
void c_value_print(struct value *, struct ui_file *, const struct value_print_options *)
struct type * builtin_void
int get_discrete_bounds(struct type *type, LONGEST *lowp, LONGEST *highp)
void error(const char *fmt,...)
void do_cleanups(struct cleanup *old_chain)
struct type * builtin_float
CORE_ADDR cplus_skip_trampoline(struct frame_info *frame, CORE_ADDR stop_pc)
struct type * builtin_int
const ULONGEST const LONGEST len