81 const char *varstring,
89 const char *local_name;
95 if (local_name != NULL)
98 if (varstring != NULL && *varstring !=
'\0')
105 if ((varstring != NULL && *varstring !=
'\0')
117 need_post_space = (varstring != NULL && strcmp (varstring,
"") != 0);
122 if (varstring != NULL)
128 if (local_name == NULL)
130 demangled_args = strchr (varstring,
'(') != NULL;
198 ?
"protected" :
"private"),
216 const char *varstring,
int staticp,
239 if (i == nargs && varargs)
295 int show,
int passed_a_ptr,
313 stream, show, 1, 1, flags);
320 stream, show, 0, 0, flags);
326 stream, -1, passed_a_ptr, flags);
332 stream, show, 0, 0, flags);
339 stream, -1, passed_a_ptr, flags);
345 stream, show, 1, 0, flags);
353 stream, show, 0, 0, flags);
360 stream, show, 0, 0, flags);
367 stream, show, passed_a_ptr, 0, flags);
390 error (
_(
"type not handled in c_type_print_varspec_prefix()"));
404 int need_pre_space,
int need_post_space)
406 int did_print_modifier = 0;
407 const char *address_space_id;
418 did_print_modifier = 1;
423 if (did_print_modifier || need_pre_space)
426 did_print_modifier = 1;
431 if (did_print_modifier || need_pre_space)
434 did_print_modifier = 1;
439 if (did_print_modifier || need_pre_space)
442 did_print_modifier = 1;
447 if (address_space_id)
449 if (did_print_modifier || need_pre_space)
452 did_print_modifier = 1;
455 if (did_print_modifier && need_post_space)
481 struct type *param_type;
525 else if (!printed_any
551 if (! strchr (
" \t\f\n\r", *name))
554 while (strchr (
" \t\f\n\r", *name))
557 if (!(
'a' <= *name && *name <=
'z')
558 && !(
'A' <= *name && *name <=
'Z')
573 if ((
'a' <= *name && *name <=
'z')
574 || (
'A' <= *name && *name <=
'Z')
575 || (
'0' <= *name && *name <=
'9')
602 char *parenstack = (
char *) alloca (strlen (qid));
607 for (scan = qid; *
scan; scan++)
613 else if (*scan ==
'\\' && *(scan + 1))
616 else if (scan[0] ==
':' && scan[1] ==
':')
629 else if (*scan ==
'"' || *scan ==
'\'')
631 else if (*scan ==
'(')
632 parenstack[depth++] =
')';
633 else if (*scan ==
'[')
634 parenstack[depth++] =
']';
638 else if (*scan ==
'<')
639 parenstack[depth++] =
'>';
640 else if (*scan ==
')' || *scan ==
']' || *scan ==
'>')
642 if (depth > 0 && parenstack[depth - 1] == *scan)
652 for (i = depth - 1; i >= 0; i--)
653 if (parenstack[i] == *scan)
677 int show,
int passed_a_ptr,
700 " __attribute__ ((vector_size(" :
"["));
707 plongest (high_bound - low_bound + 1));
740 show, passed_a_ptr, 0, flags);
745 show, passed_a_ptr, 0, flags);
769 error (
_(
"type not handled in c_type_print_varspec_suffix()"));
850 s_none, s_public, s_private, s_protected
853 int need_access_label = 0;
899 stream, show, level, flags);
955 struct type *basetype;
980 _(
"<incomplete type>\n"));
983 _(
"<no data fields>\n"));
990 section_type = s_none;
1004 need_access_label = 1;
1008 if (!need_access_label)
1011 for (j = 0; j < len2; j++)
1014 for (i = 0; i <
len; i++)
1018 need_access_label = 1;
1021 if (need_access_label)
1034 need_access_label = 1;
1038 if (!need_access_label)
1041 for (j = 0; j < len2; j++)
1045 for (i = 0; i <
len; i++)
1052 need_access_label = 1;
1055 if (need_access_label)
1073 if ((i == vptr_fieldno && type == basetype)
1077 if (need_access_label)
1081 if (section_type != s_protected)
1083 section_type = s_protected;
1090 if (section_type != s_private)
1092 section_type = s_private;
1099 if (section_type != s_public)
1101 section_type = s_public;
1113 stream, show - 1, level + 4,
1136 for (i = 0; i <
len; i++)
1142 for (j = 0; j < len2; j++)
1146 if (real_len > 0 && section_type != s_none)
1150 for (i = 0; i <
len; i++)
1159 for (j = 0; j < len2; j++)
1161 const char *mangled_name;
1162 char *demangled_name;
1163 struct cleanup *inner_cleanup;
1165 int is_full_physname_constructor =
1169 || method_name[0] ==
'~';
1180 if (section_type != s_protected)
1182 section_type = s_protected;
1189 if (section_type != s_private)
1191 section_type = s_private;
1198 if (section_type != s_public)
1200 section_type = s_public;
1215 _(
"<undefined type> %s;\n"),
1219 else if (!is_constructor
1222 && !is_full_physname_constructor
1244 DMGL_ANSI | DMGL_PARAMS);
1245 if (demangled_name == NULL)
1261 stream, &local_flags);
1265 _(
"<badly mangled name '%s'>"),
1271 char *demangled_no_class
1276 p = strstr (demangled_no_class,
" static");
1279 int length = p - demangled_no_class;
1280 char *demangled_no_static;
1283 = (
char *)
xmalloc (length + 1);
1284 strncpy (demangled_no_static,
1285 demangled_no_class, length);
1286 *(demangled_no_static +
length) =
'\0';
1288 xfree (demangled_no_static);
1292 xfree (demangled_name);
1324 stream, show - 1, level + 4,
1386 for (i = 0; i <
len; i++)
#define TYPE_HIGH_BOUND_KIND(range_type)
#define TYPE_ERROR_NAME(type)
#define TYPE_FIELD_PRIVATE(thistype, n)
void fprintf_symbol_filtered(struct ui_file *stream, const char *name, enum language lang, int arg_mode)
#define SYMBOL_PRINT_NAME(symbol)
int get_vptr_fieldno(struct type *type, struct type **basetypep)
#define TYPE_FIELD_NAME(thistype, n)
#define TYPE_N_BASECLASSES(thistype)
#define TYPE_NFN_FIELDS(thistype)
static void scan(struct macro_buffer *dest, struct macro_buffer *src, struct macro_name_list *no_loop, macro_lookup_ftype *lookup_func, void *lookup_baton)
#define TYPE_NAME(thistype)
#define TYPE_FIELD_ARTIFICIAL(thistype, n)
void c_type_print_base(struct type *type, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
char * plongest(LONGEST l)
#define SYMBOL_CLASS(symbol)
#define BASETYPE_VIA_VIRTUAL(thistype, index)
char * gdb_mangle_name(struct type *, int, int)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
#define TYPE_FN_FIELD_STATIC_P(thisfn, n)
enum language la_language
static void c_type_print_modifier(struct type *, struct ui_file *, int, int)
struct typedef_hash_table * copy_typedef_hash(struct typedef_hash_table *table)
void java_print_type(struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *)
#define TYPE_FIELD(thistype, n)
#define TYPE_PROTOTYPED(t)
#define TYPE_FIELD_ENUMVAL(thistype, n)
#define TYPE_FIELD_TYPE(thistype, n)
char * cp_canonicalize_string_full(const char *string, canonicalization_ftype *finder, void *data)
void c_type_print_args(struct type *type, struct ui_file *stream, int linkage_name, enum language language, const struct type_print_options *flags)
static void print_name_maybe_canonical(const char *name, const struct type_print_options *flags, struct ui_file *stream)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
#define TYPE_N_TEMPLATE_ARGUMENTS(thistype)
void null_cleanup(void *arg)
static void cp_type_print_method_args(struct type *mtype, const char *prefix, const char *varstring, int staticp, struct ui_file *stream, const struct type_print_options *flags)
char * gdb_demangle(const char *name, int options)
#define TYPE_INSTANCE_FLAGS(thistype)
#define TYPE_FN_FIELD_PHYSNAME(thisfn, n)
struct type * check_typedef(struct type *type)
#define TYPE_FN_FIELD_VIRTUAL_P(thisfn, n)
#define TYPE_FN_FIELD_PRIVATE(thisfn, n)
#define TYPE_TYPEDEF_FIELD_NAME(thistype, n)
static char * remove_qualifiers(char *qid)
#define TYPE_FN_FIELD_ARTIFICIAL(thisfn, n)
int field_is_static(struct field *f)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
enum ctor_kinds is_constructor_name(const char *name)
void recursively_update_typedef_hash(struct typedef_hash_table *table, struct type *t)
void c_print_type(struct type *type, const char *varstring, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
#define TYPE_TYPEDEF_FIELD_TYPE(thistype, n)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
enum dtor_kinds is_destructor_name(const char *name)
void c_print_typedef(struct type *type, struct symbol *new_symbol, struct ui_file *stream)
struct gdbarch * get_type_arch(const struct type *type)
unsigned int print_typedefs
#define SYMBOL_LINKAGE_NAME(symbol)
static int startswith(const char *string, const char *pattern)
static struct symbol * new_symbol(struct die_info *, struct type *, struct dwarf2_cu *)
#define TYPE_BASECLASS(thistype, index)
void wrap_here(char *indent)
#define TYPE_FIELD_PACKED(thistype, n)
#define TYPE_FIELDS(thistype)
unsigned int print_methods
static void c_type_print_template_args(const struct type_print_options *flags, struct type *type, struct ui_file *stream)
#define TYPE_FIELD_BITSIZE(thistype, n)
static void cp_type_print_derivation_info(struct ui_file *stream, struct type *type, const struct type_print_options *flags)
#define TYPE_FIELD_PROTECTED(thistype, n)
void fprintfi_filtered(int spaces, struct ui_file *stream, const char *format,...)
void print_spaces_filtered(int n, struct ui_file *stream)
#define TYPE_FN_FIELD_TYPE(thisfn, n)
struct type * make_cv_type(int cnst, int voltl, struct type *type, struct type **typeptr)
const struct language_defn * current_language
#define TYPE_TARGET_TYPE(thistype)
const char * find_typedef_in_hash(const struct type_print_options *flags, struct type *t)
#define TYPE_FN_FIELD_PROTECTED(thisfn, n)
#define TYPE_CODE(thistype)
const char * address_space_int_to_name(struct gdbarch *gdbarch, int space_flag)
#define TYPE_INDEX_TYPE(type)
#define TYPE_NFIELDS(thistype)
static void c_type_print_varspec_prefix(struct type *, struct ui_file *, int, int, int, const struct type_print_options *)
#define CHECK_TYPEDEF(TYPE)
#define TYPE_TAG_NAME(type)
#define BASETYPE_VIA_PUBLIC(thistype, index)
#define TYPE_TYPEDEF_FIELD_COUNT(thistype)
#define TYPE_TEMPLATE_ARGUMENT(thistype, n)
#define SYMBOL_TYPE(symbol)
void add_template_parameters(struct typedef_hash_table *table, struct type *t)
#define TYPE_FN_FIELDLIST_NAME(thistype, n)
const char * type_name_no_tag(const struct type *type)
struct cleanup * make_cleanup_free_typedef_hash(struct typedef_hash_table *table)
#define TYPE_FN_FIELDLIST_LENGTH(thistype, n)
#define TYPE_FN_FIELD_CONSTRUCTOR(thisfn, n)
struct typedef_hash_table * create_typedef_hash(void)
#define TYPE_DECLARED_CLASS(t)
static int is_type_conversion_operator(struct type *type, int i, int j)
struct typedef_hash_table * local_typedefs
int get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
#define TYPE_SELF_TYPE(thistype)
void error(const char *fmt,...)
#define TYPE_FN_FIELDLIST1(thistype, n)
void do_cleanups(struct cleanup *old_chain)
void c_type_print_varspec_suffix(struct type *type, struct ui_file *stream, int show, int passed_a_ptr, int demangled_args, const struct type_print_options *flags)
const ULONGEST const LONGEST len
#define TYPE_FN_FIELD_STUB(thisfn, n)
static const char * find_typedef_for_canonicalize(struct type *t, void *data)