41 #define OFFSET_SPC_LEN 23 103 const char *varstring,
112 const char *local_name;
118 if (local_name != NULL)
121 if (varstring != NULL && *varstring !=
'\0')
128 if ((varstring != NULL && *varstring !=
'\0')
140 need_post_space = (varstring != NULL && strcmp (varstring,
"") != 0);
145 if (varstring != NULL)
151 if (local_name == NULL)
153 demangled_args = strchr (varstring,
'(') != NULL;
165 const char *varstring,
235 ?
"protected" :
"private"),
253 const char *varstring,
int staticp,
276 struct field arg = args[i++];
284 if (i == nargs && varargs)
340 int show,
int passed_a_ptr,
359 stream, show, 1, 1,
flags, podata);
366 stream, show, 0, 0,
flags, podata);
372 stream, -1, passed_a_ptr,
flags, podata);
378 stream, show, 0, 0,
flags, podata);
385 stream, -1, passed_a_ptr,
flags, podata);
392 stream, show, 1, 0,
flags, podata);
400 stream, show, 0, 0,
flags, podata);
407 stream, show, 0, 0,
flags, podata);
414 stream, show, passed_a_ptr, 0,
flags,
439 error (
_(
"type not handled in c_type_print_varspec_prefix()"));
453 int need_pre_space,
int need_post_space)
455 int did_print_modifier = 0;
456 const char *address_space_id;
466 did_print_modifier = 1;
471 if (did_print_modifier || need_pre_space)
474 did_print_modifier = 1;
479 if (did_print_modifier || need_pre_space)
482 did_print_modifier = 1;
487 if (did_print_modifier || need_pre_space)
490 did_print_modifier = 1;
495 if (address_space_id)
497 if (did_print_modifier || need_pre_space)
500 did_print_modifier = 1;
503 if (did_print_modifier && need_post_space)
529 struct type *param_type;
570 else if (!printed_any
595 if (! strchr (
" \t\f\n\r", *
name))
598 while (strchr (
" \t\f\n\r", *
name))
646 char *parenstack = (
char *) alloca (strlen (qid));
657 else if (*
scan ==
'\\' && *(
scan + 1))
660 else if (
scan[0] ==
':' &&
scan[1] ==
':')
673 else if (*
scan ==
'"' || *
scan ==
'\'')
675 else if (*
scan ==
'(')
676 parenstack[depth++] =
')';
677 else if (*
scan ==
'[')
678 parenstack[depth++] =
']';
682 else if (*
scan ==
'<')
683 parenstack[depth++] =
'>';
686 if (depth > 0 && parenstack[depth - 1] == *
scan)
696 for (i = depth - 1; i >= 0; i--)
697 if (parenstack[i] == *
scan)
721 int show,
int passed_a_ptr,
744 " __attribute__ ((vector_size(" :
"["));
751 plongest (high_bound - low_bound + 1));
785 show, passed_a_ptr, 0,
flags);
790 show, passed_a_ptr, 0,
flags);
815 error (
_(
"type not handled in c_type_print_varspec_suffix()"));
878 if (!
flags->print_offsets)
890 int level,
bool is_protected,
bool is_private,
977 unsigned int hole = bitpos - podata->
end_bitpos;
995 unsigned int relative_bitpos;
999 if ((bitpos % fieldsize_bit) + bitsize <= fieldsize_bit)
1000 relative_bitpos = bitpos % fieldsize_bit;
1005 unsigned int bit_offset
1012 fieldsize_bit - (relative_bitpos + bitsize));
1013 fieldsize_bit = bitsize;
1087 const char *varstring,
1089 int show,
int level,
1093 unsigned int old_po =
flags->print_offsets;
1097 flags->print_offsets = 0;
1099 flags->print_offsets = old_po;
1107 int show,
int level,
1120 if (
flags->local_typedefs)
1161 struct type *basetype;
1187 _(
"<incomplete type>\n"));
1190 _(
"<no data fields>\n"));
1220 if ((i == vptr_fieldno &&
type == basetype)
1224 if (need_access_label)
1227 (stream, section_type, level,
1234 if (
flags->print_offsets)
1241 (
type, i, stream, podata);
1254 int newshow = show - 1;
1256 if (
flags->print_offsets
1283 stream, newshow, level + 4,
1284 &local_flags, &local_podata);
1303 if (!
flags->print_methods)
1306 for (
int i = 0; i < len; i++)
1312 for (j = 0; j < len2; j++)
1316 if (real_len > 0 && section_type !=
s_none)
1320 for (
int i = 0; i < len; i++)
1329 for (j = 0; j < len2; j++)
1331 const char *mangled_name;
1333 char *demangled_name;
1335 int is_full_physname_constructor =
1339 || method_name[0] ==
'~';
1347 (stream, section_type, level,
1361 _(
"<undefined type> %s;\n"),
1368 && !is_full_physname_constructor
1373 "", stream, -1, 0, &local_flags, podata);
1381 mangled_name = mangled_name_holder.get ();
1388 DMGL_ANSI | DMGL_PARAMS);
1389 if (demangled_name == NULL)
1405 stream, &local_flags);
1409 _(
"<badly mangled name '%s'>"),
1415 char *demangled_no_class
1420 p = strstr (demangled_no_class,
" static");
1423 int length = p - demangled_no_class;
1424 char *demangled_no_static;
1428 strncpy (demangled_no_static,
1429 demangled_no_class,
length);
1430 *(demangled_no_static +
length) =
'\0';
1432 xfree (demangled_no_static);
1436 xfree (demangled_name);
1458 "", stream, show, level + 4,
1459 &semi_local_flags, podata);
1480 if (need_access_label)
1483 (stream, section_type, level,
1496 stream, show - 1, level + 4,
1497 &semi_local_flags, podata);
1502 if (
flags->print_offsets)
1545 int show,
int level,
1593 stream, show, level,
flags, podata);
1602 stream, show, level,
flags, podata);
1660 for (i = 0; i < len; i++)
1696 _(
"<incomplete type>\n"));
1699 _(
"<no data fields>\n"));
1702 for (i = 0; i < len; i++)
1710 stream, show, level + 4,
1711 &local_flags, podata);
1775 int show,
int level,
#define TYPE_HIGH_BOUND_KIND(range_type)
static void print_spaces_filtered_with_print_options(int level, struct ui_file *stream, const struct type_print_options *flags)
#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 FIELD_ARTIFICIAL(thisfld)
#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)
static void c_print_type_1(struct type *type, const char *varstring, struct ui_file *stream, int show, int level, const struct type_print_options *flags, struct print_offset_data *podata)
struct typedef_hash_table * copy_typedef_hash(struct typedef_hash_table *table)
#define TYPE_FIELD(thistype, n)
#define TYPE_NESTED_TYPES_COUNT(thistype)
#define TYPE_PROTOTYPED(t)
#define TYPE_FIELD_ENUMVAL(thistype, n)
#define TYPE_FIELD_TYPE(thistype, n)
static void c_type_print_base_1(struct type *type, struct ui_file *stream, int show, int level, const struct type_print_options *flags, struct print_offset_data *podata)
void c_type_print_args(struct type *type, struct ui_file *stream, int linkage_name, enum language language, const struct type_print_options *flags)
#define TYPE_IS_REFERENCE(t)
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)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
#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)
static void c_print_type_union_field_offset(struct type *type, unsigned int field_idx, struct ui_file *stream)
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)
#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)
#define TYPE_FIELD_PACKED(thistype, n)
#define TYPE_FIELDS(thistype)
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_BITPOS(thistype, n)
static void c_print_type_no_offsets(struct type *type, const char *varstring, struct ui_file *stream, int show, int level, struct type_print_options *flags, struct print_offset_data *podata)
std::string cp_canonicalize_string_full(const char *string, canonicalization_ftype *finder, void *data)
void wrap_here(const char *indent)
void type_print_unknown_return_type(struct ui_file *stream)
#define TYPE_FIELD_PROTECTED(thistype, n)
void fprintfi_filtered(int spaces, struct ui_file *stream, const char *format,...)
#define TYPE_TYPEDEF_FIELD_PRIVATE(thistype, n)
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)
#define TYPE_TYPEDEF_FIELD_PROTECTED(thistype, n)
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)
int print_nested_type_limit
static void c_type_print_base_struct_union(struct type *type, struct ui_file *stream, int show, int level, const struct type_print_options *flags, struct print_offset_data *podata)
static enum access_specifier output_access_specifier(struct ui_file *stream, enum access_specifier last_access, int level, bool is_protected, bool is_private, const struct type_print_options *flags)
#define TYPE_CODE(thistype)
const char * address_space_int_to_name(struct gdbarch *gdbarch, int space_flag)
#define TYPE_INDEX_TYPE(type)
#define TYPE_NESTED_TYPES_FIELD_TYPE(thistype, n)
static void c_print_type_struct_field_offset(struct type *type, unsigned int field_idx, struct ui_file *stream, struct print_offset_data *podata)
static void c_type_print_varspec_prefix(struct type *, struct ui_file *, int, int, int, const struct type_print_options *, struct print_offset_data *)
#define TYPE_NFIELDS(thistype)
unsigned int offset_bitpos
#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)
static bool need_access_label_p(struct type *type)
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)
#define TYPE_LENGTH(thistype)
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)
#define TYPE_FN_FIELD_STUB(thisfn, n)
static const char * find_typedef_for_canonicalize(struct type *t, void *data)