62 if (low_bound > high_bound)
112 int offset,
struct ui_file *stream,
117 unsigned int things_printed = 0;
142 len = high - low + 1;
151 while (i < len && things_printed < options->print_max)
158 struct value *v0, *v1;
183 (i0 *
bitsize) / HOST_CHAR_BIT,
184 (i0 *
bitsize) % HOST_CHAR_BIT,
211 opts.deref_ref =
false;
214 gdb_printf (stream, _(
" %p[<repeats %u times>%p]"),
224 opts.deref_ref =
false;
225 for (j = i0; j < i; j += 1)
247 things_printed += i - i0;
262 int quoter,
int type_len)
270 if (c <= UCHAR_MAX && isascii (c) && isprint (c))
272 if (c == quoter && c ==
'"')
281 gdb_printf (stream,
"[\"%0*x\"]", std::min (6, type_len * 2), c);
289char_at (
const gdb_byte *
string,
int i,
int type_len,
290 enum bfd_endian byte_order)
296 type_len, byte_order);
312 std::string s = tmp_stream.
release ();
313 size_t skip_count = 0;
324 size_t pos = s.find (
"inf");
325 if (pos == std::string::npos)
326 pos = s.find (
"Inf");
327 if (pos == std::string::npos)
328 pos = s.find (
"INF");
329 if (pos != std::string::npos)
330 s.replace (pos, 3,
"Inf");
332 if (pos == std::string::npos)
334 pos = s.find (
"nan");
335 if (pos == std::string::npos)
336 pos = s.find (
"NaN");
337 if (pos == std::string::npos)
338 pos = s.find (
"Nan");
339 if (pos != std::string::npos)
341 s[pos] = s[pos + 2] =
'N';
347 if (pos == std::string::npos
348 && s.find (
'.') == std::string::npos)
351 if (pos == std::string::npos)
354 gdb_printf (stream,
"%.*s.0%s", (
int) pos, s.c_str (), &s[pos]);
389 if (
posn.has_value ())
409 case TYPE_CODE_RANGE:
415 case TYPE_CODE_ARRAY:
416 case TYPE_CODE_STRUCT:
417 case TYPE_CODE_UNION:
422 case TYPE_CODE_STRING:
423 case TYPE_CODE_ERROR:
424 case TYPE_CODE_MEMBERPTR:
425 case TYPE_CODE_METHODPTR:
426 case TYPE_CODE_METHOD:
428 warning (_(
"internal error: unhandled type in ada_print_scalar"));
432 error (_(
"Invalid type code in symbol table."));
444 unsigned int length,
int force_ellipses,
int type_len,
449 unsigned int things_printed = 0;
479 &&
char_at (
string, rep1, type_len, byte_order)
480 ==
char_at (
string, i, type_len, byte_order))
495 elttype, stream,
'\'', type_len);
497 gdb_printf (stream, _(
" %p[<repeats %u times>%p]"),
511 elttype, stream,
'"', type_len);
520 if (force_ellipses || i < length)
526 const gdb_byte *
string,
unsigned int length,
527 const char *encoding,
int force_ellipses,
536 struct value *outer_value,
537 struct ui_file *stream,
int recurse,
571 struct ui_file *stream,
int recurse,
581 for (i = 0; i < len; i += 1)
592 stream, recurse, options,
644 bit_pos / HOST_CHAR_BIT,
645 bit_pos % HOST_CHAR_BIT,
648 opts.deref_ref =
false;
656 opts.deref_ref =
false;
673 struct ui_file *stream,
int recurse,
685 gdb_assert (elttype != NULL);
686 gdb_assert (elttype->
length () != 0);
688 eltlen = elttype->
length ();
701 && temp_len < print_max_chars
702 &&
char_at (valaddr + offset_aligned,
703 temp_len, eltlen, byte_order) != 0);
708 printstr (stream, elttype, valaddr + offset_aligned, len, 0,
717 struct ui_file *stream,
int recurse,
750 if (
type->
code () == TYPE_CODE_RANGE
831 if (
posn.has_value ())
899 stream, recurse, options);
911 int offset,
int offset_aligned, CORE_ADDR address,
912 struct ui_file *stream,
int recurse,
913 struct value *original_value,
922 struct value *deref_val;
923 CORE_ADDR deref_val_int;
944 if (deref_val_int == 0)
956 if (deref_val->
lazy ())
984 gdb_assert (
type->
code () == TYPE_CODE_TYPEDEF);
996 CORE_ADDR address = val->
address ();
997 gdb::array_view<const gdb_byte> view
998 = gdb::make_array_view (valaddr,
type->
length ());
1000 if (
type != saved_type)
1021 case TYPE_CODE_RANGE:
1025 case TYPE_CODE_ENUM:
1040 case TYPE_CODE_UNION:
1041 case TYPE_CODE_STRUCT:
1045 case TYPE_CODE_ARRAY:
1051 address, stream, recurse, val,
1087 if (
type->
code () == TYPE_CODE_TYPEDEF)
1096 opts.deref_ref =
true;
struct value * ada_value_primitive_packed_val(struct value *obj, const gdb_byte *valaddr, long offset, int bit_offset, int bit_size, struct type *type)
const gdb_byte * ada_aligned_value_addr(struct type *type, const gdb_byte *valaddr)
struct value * ada_get_decoded_value(struct value *value)
int ada_is_variant_part(struct type *type, int field_num)
int ada_which_variant_applies(struct type *var_type, struct value *outer)
bool ada_is_string_type(struct type *type)
int ada_is_array_descriptor_type(struct type *type)
bool ada_is_character_type(struct type *type)
int ada_is_system_address_type(struct type *type)
int ada_is_constrained_packed_array_type(struct type *type)
int ada_name_prefix_len(const char *name)
struct value * ada_tag_value_at_base_address(struct value *obj)
struct type * ada_check_typedef(struct type *type)
int ada_is_wrapper_field(struct type *type, int field_num)
int ada_is_tagged_type(struct type *type, int refok)
int ada_is_tag_type(struct type *type)
struct value * ada_value_ind(struct value *val0)
const char * ada_enum_name(const char *name)
struct value * ada_value_primitive_field(struct value *arg1, int offset, int fieldno, struct type *arg_type)
int ada_is_ignored_field(struct type *type, int field_num)
gdb::unique_xmalloc_ptr< char > ada_tag_name(struct value *tag)
struct value * ada_to_fixed_value(struct value *val)
static int print_variant_part(struct value *value, int field_num, struct value *outer_value, struct ui_file *stream, int recurse, const struct value_print_options *options, int comma_needed, const struct language_defn *language)
void ada_printchar(int c, struct type *type, struct ui_file *stream)
static int print_optional_low_bound(struct ui_file *stream, struct type *type, const struct value_print_options *options)
void ada_print_scalar(struct type *type, LONGEST val, struct ui_file *stream)
void ada_value_print_inner(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options)
void ada_value_print(struct value *val0, struct ui_file *stream, const struct value_print_options *options)
static int char_at(const gdb_byte *string, int i, int type_len, enum bfd_endian byte_order)
static void printstr(struct ui_file *stream, struct type *elttype, const gdb_byte *string, unsigned int length, int force_ellipses, int type_len, const struct value_print_options *options)
static void val_print_packed_array_elements(struct type *type, const gdb_byte *valaddr, int offset, struct ui_file *stream, int recurse, const struct value_print_options *options)
static int print_field_values(struct value *, struct value *, struct ui_file *, int, const struct value_print_options *, int, const struct language_defn *)
static void ada_val_print_enum(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options)
static void ada_value_print_ptr(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options)
static void ada_val_print_string(struct type *type, const gdb_byte *valaddr, int offset_aligned, struct ui_file *stream, int recurse, const struct value_print_options *options)
void ada_printstr(struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, const struct value_print_options *options)
static void ada_print_floating(const gdb_byte *valaddr, struct type *type, struct ui_file *stream)
static void ada_value_print_array(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options)
static void ada_val_print_ref(struct type *type, const gdb_byte *valaddr, int offset, int offset_aligned, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options)
void ada_emit_char(int c, struct type *type, struct ui_file *stream, int quoter, int type_len)
static void ada_value_print_num(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options)
static void ada_val_print_struct_union(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options)
void annotate_field_value(void)
void annotate_field_begin(struct type *type)
void annotate_field_name_end(void)
void annotate_elt_rep_end(void)
void annotate_array_section_begin(int idx, struct type *elttype)
void annotate_array_section_end(void)
void annotate_elt_rep(unsigned int repcount)
void annotate_field_end(void)
ui_file_style style() const
virtual void wrap_here(int indent)
cli_style_option variable_name_style
cli_style_option metadata_style
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
enum bfd_endian type_byte_order(const struct type *type)
struct type * lookup_pointer_type(struct type *type)
bool get_discrete_bounds(struct type *type, LONGEST *lowp, LONGEST *highp)
struct type * resolve_dynamic_type(struct type *type, gdb::array_view< const gdb_byte > valaddr, CORE_ADDR addr, const frame_info_ptr *in_frame)
gdb::optional< LONGEST > discrete_position(struct type *type, LONGEST val)
bool get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
bool is_fixed_point_type(struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_FIELD_IGNORE(thistype, n)
#define HAVE_CPLUS_STRUCT(type)
const struct language_defn * language_def(enum language lang)
const struct language_defn * current_language
static bfd_vma posn(struct mem_read_abstraction_base *b)
struct type * builtin_data_ptr
LONGEST loc_bitpos() const
LONGEST loc_enumval() const
const char * name() const
unsigned int bitsize() const
struct type * type() const
virtual void printchar(int ch, struct type *chtype, struct ui_file *stream) const
struct type * target_type() const
struct field & field(int idx) const
unsigned int num_fields() const
type * index_type() const
struct type * fixed_point_type_base_type()
const ui_file_style * ptr() const
enum val_prettyformat prettyformat
unsigned int repeat_count_threshold
unsigned int print_max_chars
struct value * copy() const
LONGEST embedded_offset() const
struct type * type() const
bool entirely_optimized_out()
bool contents_eq(LONGEST offset1, const struct value *val2, LONGEST offset2, LONGEST length) const
void deprecated_set_type(struct type *type)
gdb::array_view< const gdb_byte > contents_for_printing()
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
static styled_string_s * styled_string(const ui_file_style &style, const char *str, styled_string_s &&tmp={})
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void print_spaces(int n, struct ui_file *stream)
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)
struct value * value_cast(struct type *type, struct value *arg2)
void value_print_scalar_formatted(struct value *val, const struct value_print_options *options, int size, struct ui_file *stream)
void val_print_optimized_out(const struct value *val, struct ui_file *stream)
void print_floating(const gdb_byte *valaddr, struct type *type, struct ui_file *stream)
void value_print_array_elements(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, unsigned int i)
void print_longest(struct ui_file *stream, int format, int use_c_format, LONGEST val_long)
void common_val_print(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
void maybe_print_array_index(struct type *index_type, LONGEST index, struct ui_file *stream, const struct value_print_options *options)
static unsigned int get_print_max_chars(const struct value_print_options *options)
struct value * coerce_ref_if_computed(const struct value *arg)
struct value * value_field(struct value *arg1, int fieldno)
CORE_ADDR unpack_pointer(struct type *type, const gdb_byte *valaddr)
struct value * coerce_ref(struct value *arg)
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)
LONGEST unpack_long(struct type *type, const gdb_byte *valaddr)