44 switch (str_type & ~
C_CHAR)
74 const char **encoding)
93 if (!strcmp (
name,
"wchar_t"))
99 if (!strcmp (
name,
"char16_t"))
105 if (!strcmp (
name,
"char32_t"))
144 struct ui_file *stream,
int quoter)
146 const char *encoding;
155 c_string_type str_type;
187 const gdb_byte *
string,
unsigned int length,
188 const char *user_encoding,
int force_ellipses,
191 c_string_type str_type;
192 const char *type_encoding;
193 const char *encoding;
212 encoding = (user_encoding && *user_encoding) ? user_encoding : type_encoding;
237 int *length,
struct type **char_type,
238 const char **charset)
241 unsigned int fetchlimit;
245 enum bfd_endian byte_order
248 if (element_type == NULL)
261 &low_bound, &high_bound);
262 fetchlimit = high_bound - low_bound + 1;
294 for (i = 0; i < fetchlimit; i++)
296 width, byte_order) == 0)
338 if (req_length == -1)
342 width, byte_order) == 0)
351 *char_type = element_type;
358 if (!type_str.empty ())
360 error (
_(
"Trying to read string with inappropriate type `%s'."),
364 error (
_(
"Trying to read string with inappropriate type."));
379 struct obstack *output,
int length)
381 unsigned long result = 0;
385 for (i = 0; i <
length && p < limit && isxdigit (*p); ++i, ++p)
388 for (i = 3; i >= 0; --i)
390 data[i] = result & 0xff;
405 struct obstack *output)
421 char *limit,
struct obstack *output)
424 unsigned long value = 0;
427 i < 3 && p < limit && isdigit (*p) && *p !=
'8' && *p !=
'9';
446 char *limit,
struct obstack *output)
448 unsigned long value = 0;
450 while (p < limit && isxdigit (*p))
465 error (_("Malformed escape sequence")); \ 477 char *p,
char *limit,
struct obstack *output)
485 obstack_1grow (output,
'\\');
492 error (
_(
"\\x used with no following hex digits."));
510 int length = *p ==
'u' ? 4 : 8;
514 error (
_(
"\\u used with no following hex digits"));
530 const char *dest_charset,
struct type *
type)
541 while (p < limit && *p !=
'\\')
571 struct value *result;
572 c_string_type dest_type;
573 const char *dest_charset;
574 int satisfy_expected = 0;
585 switch (dest_type & ~
C_CHAR)
597 "char16_t", NULL, 0);
601 "char32_t", NULL, 0);
615 struct type *element_type
622 satisfy_expected = 1;
648 if (expect_type != NULL)
650 else if ((dest_type &
C_CHAR) != 0)
657 if ((dest_type &
C_CHAR) != 0)
662 error (
_(
"Could not convert character " 663 "constant to target character set"));
673 obstack_1grow (&output, 0);
675 if (satisfy_expected)
681 &low_bound, &high_bound) < 0)
684 high_bound = (
TYPE_LENGTH (expect_type) / element_size) - 1;
686 if (obstack_object_size (&output) / element_size
687 > (high_bound - low_bound + 1))
688 error (
_(
"Too many array elements"));
692 obstack_object_size (&output));
695 result =
value_cstring ((
const char *) obstack_base (&output),
696 obstack_object_size (&output),
974 ".C",
".cc",
".cp",
".cpp",
".cxx",
".c++", NULL
1028 ".s",
".sx",
".S", NULL
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
struct type * cp_lookup_transparent_type(const char *name)
union exp_element elts[1]
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)
const struct language_defn c_language_defn
const struct language_defn cplus_language_defn
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
unsigned int default_search_name_hash(const char *string0)
struct type * builtin_double_complex
#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE)
const char * default_word_break_characters(void)
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,...)
static const char * c_extensions[]
const struct language_defn * language_defn
int operator_check_standard(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
void c_language_arch_info(struct gdbarch *gdbarch, struct language_arch_info *lai)
struct value * default_read_var_value(struct symbol *var, const struct block *var_block, struct frame_info *frame)
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 c_get_string(struct value *value, gdb_byte **buffer, int *length, struct type **char_type, const char **charset)
const struct language_defn asm_language_defn
unsigned int cp_search_name_hash(const char *search_name)
struct type * builtin_short
struct type * builtin_char16
int longest_to_int(LONGEST)
std::string c_compute_program(struct compile_instance *inst, const char *input, struct gdbarch *gdbarch, const struct block *expr_block, CORE_ADDR expr_pc)
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)
#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)
static c_string_type classify_type(struct type *elttype, struct gdbarch *gdbarch, const char **encoding)
const struct exp_descriptor exp_descriptor_c
struct type * builtin_unsigned_long
struct type * builtin_char32
struct block_symbol basic_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
struct type * bool_type_default
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
void c_emit_char(int c, struct type *type, struct ui_file *stream, int quoter)
const char * target_wide_charset(struct gdbarch *gdbarch)
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
void c_yyerror(const char *)
const char * bool_type_symbol
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 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)
void null_post_parser(expression_up *exp, int void_context_p)
struct value * value_from_longest(struct type *type, LONGEST num)
struct type * builtin_decfloat
struct type * builtin_long
struct block_symbol cp_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
const struct lang_varobj_ops cplus_varobj_ops
symbol_name_matcher_ftype * cp_get_symbol_name_matcher(const lookup_name_info &lookup_name)
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 * xstrprintf(const char *format,...)
void c_val_print(struct type *, int, CORE_ADDR, struct ui_file *, int, struct value *, const struct value_print_options *)
void c_print_typedef(struct type *, struct symbol *, struct ui_file *)
static const char * cplus_extensions[]
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)
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)
void default_collect_symbol_completion_matches(completion_tracker &tracker, complete_symbol_mode mode, symbol_name_match_type name_match_type, const char *text, const char *word, enum type_code code)
char * cp_class_name_from_physname(const char *physname)
struct compile_instance * c_get_compile_context(void)
static const char * asm_extensions[]
struct type * builtin_wchar
int read_string(CORE_ADDR addr, int len, int width, unsigned int fetchlimit, enum bfd_endian byte_order, gdb_byte **buffer, int *bytes_read)
gdb::unique_xmalloc_ptr< char > c_watch_location_expression(struct type *type, CORE_ADDR addr)
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 *)
const struct language_defn minimal_language_defn
int gdb_sniff_from_mangled_name(const char *mangled, char **demangled)
#define TYPE_NFIELDS(thistype)
void generic_emit_char(int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding)
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)
const char * op_name_standard(enum exp_opcode opcode)
static char * convert_octal(struct type *type, char *p, char *limit, struct obstack *output)
struct type * builtin_long_long
struct type * value_type(const struct value *value)
void c_printchar(int c, struct type *type, struct ui_file *stream)
const char * core_addr_to_string(const CORE_ADDR addr)
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)
void iterate_over_symbols(const struct block *block, const lookup_name_info &name, const domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback)
std::string type_to_string(struct type *type)
struct value * value_cstring(const char *ptr, ssize_t len, struct type *char_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,...)
struct type * builtin_float
static const char * charset_for_string_type(c_string_type str_type, struct gdbarch *gdbarch)
CORE_ADDR cplus_skip_trampoline(struct frame_info *frame, CORE_ADDR stop_pc)
struct type * builtin_int