69 while (s >
name_buffer && (s[0] !=
'_' || s[-1] !=
'_'))
80 if (s[0] ==
'_' && s[1] ==
'_')
102 struct type *subtype;
104 if (
type->
code () != TYPE_CODE_RANGE)
130 int bounds_preferred_p)
132 if (!bounds_preferred_p)
151 case TYPE_CODE_RANGE:
154 LONGEST lo = 0, hi = 0;
162 catch (
const gdb_exception_error &e)
220 const char *bound =
bounds + *n;
223 pend = strstr (bound,
"__");
225 *n += bound_len = strlen (bound);
228 bound_len = pend - bound;
231 gdb_printf (stream,
"%.*s", bound_len, bound);
241 const char *suffix,
struct ui_file *stream)
244 std::string name_buf (
name, name_len);
263 int bounds_preferred_p)
266 struct type *base_type;
267 const char *subtype_info;
269 gdb_assert (raw_type != NULL);
271 gdb_assert (
name != NULL);
273 if (raw_type->
code () == TYPE_CODE_RANGE)
276 base_type = raw_type;
278 subtype_info = strstr (
name,
"___XD");
279 if (subtype_info == NULL)
280 print_range (raw_type, stream, bounds_preferred_p);
283 int prefix_len = subtype_info -
name;
284 const char *bounds_str;
288 bounds_str = strchr (subtype_info,
'_');
291 if (*subtype_info ==
'L')
302 if (*subtype_info ==
'U')
323 for (i = 0; i < len; i++)
353 struct type *elt_type = NULL;
364 _(
"<undecipherable array type>"));
371 struct type *range_desc_type;
372 struct type *arr_type;
378 if (range_desc_type == NULL)
380 for (arr_type =
type; arr_type->
code () == TYPE_CODE_ARRAY; )
382 if (arr_type !=
type)
394 if (arr_type->
name () !=
nullptr)
403 for (k = 0, arr_type =
type;
421 gdb_printf (stream,
"%s<>", i == i0 ?
"" :
", ");
427 ada_print_type (elt_type,
"", stream, show == 0 ? 0 : show - 1, level + 1,
433 gdb_printf (stream,
" <packed: %d-bit elements>", bitsize);
445 struct type *val_type)
528 for (
int i = 0; i < var_type->
num_fields (); i += 1)
534 outer_type, stream, show, level,
541 stream, show, level,
flags);
559 struct type *var_type, *par_type;
560 struct type *discr_type;
565 if (var_type->
code () == TYPE_CODE_PTR)
568 if (var_type == NULL || var_type->
code () != TYPE_CODE_UNION)
573 if (par_type != NULL)
590 struct ui_file *stream,
int show,
int level,
601 gdb_printf (stream,
"\n%*send case;", level + 4,
"");
616 struct ui_file *stream,
int show,
int level,
626 for (i = fld0; i <= fld1; i += 1)
634 stream, show, level,
flags);
646 stream, show - 1, level + 4,
flags);
655 (
const gdb::array_view<variant_part> &parts,
665 struct ui_file *stream,
int level)
701 struct type *discr_type =
nullptr;
725 show, level + 8,
flags);
730 gdb_printf (stream,
"\n%*send case;", level + 4,
"");
751 if (part.variants.empty ())
755 int first_varying = part.variants[0].first_field;
757 first_varying - 1, stream,
773 struct ui_file *stream,
int show,
int level,
793 stream, show, level,
flags);
805 struct type *parent_type;
821 if (parent_name == NULL)
823 gdb_printf (stream,
"new %s with record", parent_name);
837 if (parent_type != NULL &&
ada_type_name (parent_type) == NULL)
839 stream, show, level,
flags);
844 gdb_printf (stream,
"\n%*send record", level,
"");
846 gdb_printf (stream, _(
" <incomplete type> end record"));
862 gdb_printf (stream,
"record (?) is ... end record");
864 gdb_printf (stream,
"record (?) is null; end record");
867 gdb_printf (stream,
"record (?) is\n%*scase ? is", level + 4,
"");
871 gdb_printf (stream,
"\n%*send case;\n%*send record",
872 level + 4,
"", level,
"");
893 if (
name != NULL &&
name[0] !=
'\0')
902 for (i = 0; i < len; i += 1)
917 gdb_printf (stream,
" return <unknown return type>");
941 struct ui_file *stream,
int show,
int level,
944 if (type0->
code () == TYPE_CODE_INTERNAL_FUNCTION)
964 if (type_name ==
nullptr)
966 int is_var_decl = (varstring != NULL && varstring[0] !=
'\0');
977 if (is_var_decl &&
type->
code () != TYPE_CODE_FUNC)
1002 case TYPE_CODE_TYPEDEF:
1006 || (varstring !=
nullptr
1007 && strstr (varstring,
"___XVL") ==
nullptr))
1017 case TYPE_CODE_ARRAY:
1020 case TYPE_CODE_BOOL:
1029 _(
"<%s-byte integer>"),
1038 case TYPE_CODE_RANGE:
1056 _(
"<%s-byte float>"),
1059 case TYPE_CODE_ENUM:
1065 case TYPE_CODE_STRUCT:
1071 case TYPE_CODE_UNION:
1074 case TYPE_CODE_FUNC:
struct type * ada_array_element_type(struct type *type, int nindices)
ULONGEST ada_modulus(struct type *type)
int ada_is_variant_part(struct type *type, int field_num)
int ada_is_modular_type(struct type *type)
struct type * ada_coerce_to_simple_array_type(struct type *type)
bool get_int_var_value(const char *name, LONGEST &value)
int ada_is_array_descriptor_type(struct type *type)
const char * ada_type_name(struct type *type)
struct type * ada_find_parallel_type(struct type *type, const char *suffix)
struct type * ada_get_base_type(struct type *raw_type)
struct type * ada_parent_type(struct type *type)
int ada_is_simple_array_type(struct type *type)
LONGEST ada_discrete_type_high_bound(struct type *type)
int ada_is_parent_field(struct type *type, int field_num)
int ada_is_constrained_packed_array_type(struct type *type)
int ada_name_prefix_len(const char *name)
struct type * ada_aligned_type(struct type *type)
struct type * ada_check_typedef(struct type *type)
int ada_is_range_type_name(const char *name)
int ada_is_wrapper_field(struct type *type, int field_num)
int ada_is_tagged_type(struct type *type, int refok)
int ada_is_aligner_type(struct type *type)
int ada_scan_number(const char str[], int k, LONGEST *R, int *new_k)
LONGEST ada_discrete_type_low_bound(struct type *type)
const char * ada_enum_name(const char *name)
void ada_fixup_array_indexes_type(struct type *index_desc_type)
int ada_is_ignored_field(struct type *type, int field_num)
int ada_array_arity(struct type *type)
struct type * ada_variant_discrim_type(struct type *var_type, struct type *outer_type)
const char * ada_variant_discrim_name(struct type *type0)
void ada_print_scalar(struct type *, LONGEST, struct ui_file *)
static void print_range_type(struct type *raw_type, struct ui_file *stream, int bounds_preferred_p)
static char * name_buffer
static void print_record_field_types_dynamic(const gdb::array_view< variant_part > &parts, int from, int to, struct type *type, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
static void print_enum_type(struct type *type, struct ui_file *stream)
void ada_print_typedef(struct type *type, struct symbol *new_symbol, struct ui_file *stream)
static int print_record_field_types(struct type *, struct type *, struct ui_file *, int, int, const struct type_print_options *)
static void print_record_type(struct type *type0, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
static int print_selected_record_field_types(struct type *, struct type *, int, int, struct ui_file *, int, int, const struct type_print_options *)
static void print_dynamic_range_bound(struct type *type, const char *name, int name_len, const char *suffix, struct ui_file *stream)
static void print_range(struct type *type, struct ui_file *stream, int bounds_preferred_p)
static void print_variant_part(struct type *type, int field_num, struct type *outer_type, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
static char * decoded_type_name(struct type *type)
static void print_range_bound(struct type *type, const char *bounds, int *n, struct ui_file *stream)
static int name_buffer_len
static int print_choices(struct type *type, int field_num, struct ui_file *stream, struct type *val_type)
static int type_is_full_subrange_of_target_type(struct type *type)
static void print_variant_clauses(struct type *var_type, struct type *discr_type, struct type *outer_type, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
static void print_array_type(struct type *type, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
static void print_unchecked_union_type(struct type *type, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
static void print_func_type(struct type *type, struct ui_file *stream, const char *name, const struct type_print_options *flags)
void ada_print_type(struct type *type0, const char *varstring, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
void * xrealloc(void *ptr, size_t size)
void c_print_type(struct type *type, const char *varstring, struct ui_file *stream, int show, int level, enum language language, const struct type_print_options *flags)
ui_file_style style() const
virtual void wrap_here(int indent)
cli_style_option function_name_style
cli_style_option variable_name_style
cli_style_option metadata_style
int is_dynamic_type(struct type *type)
bool is_fixed_point_type(struct type *type)
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly 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
static struct symbol * new_symbol(struct die_info *, struct type *, struct dwarf2_cu *, struct symbol *=NULL)
dynamic_prop_kind kind() const
struct type * original_type() const
const gdb::array_view< variant_part > * variant_parts() const
LONGEST loc_enumval() const
const char * name() const
unsigned int bitsize() const
struct type * type() const
struct type * target_type() const
dynamic_prop * dyn_prop(dynamic_prop_node_kind kind) const
struct field & field(int idx) const
unsigned int num_fields() const
range_bounds * bounds() const
const char * name() const
type * index_type() const
gdb::array_view< variant > variants
gdb::array_view< variant_part > parts
gdb::array_view< discriminant_range > discriminants
void print_type_fixed_point(struct type *type, struct ui_file *stream)
const struct type_print_options type_print_raw_options
void fprintf_styled(struct ui_file *stream, const ui_file_style &style, const char *format,...)
void gdb_printf(struct ui_file *stream, const char *format,...)
void fputs_styled(const char *linebuffer, const ui_file_style &style, struct ui_file *stream)
void gdb_puts(const char *linebuffer, struct ui_file *stream)