23#include "gdbsupport/gdb_obstack.h"
41#include "gdbsupport/byte-vector.h"
68 struct ui_file *stream,
int recurse,
79 int length_pos, length_size, string_pos;
80 struct type *char_type;
89 LONGEST low_bound, high_bound;
93 len = high_bound - low_bound + 1;
95 eltlen = elttype->
length ();
100 || ((eltlen == 1 || eltlen == 2 || eltlen == 4)
101 && elttype->
code () == TYPE_CODE_CHAR
108 unsigned int print_max_chars
110 unsigned int temp_len;
115 (valaddr + temp_len * eltlen, eltlen, byte_order)
117 && temp_len < print_max_chars);
134 gdb_printf (stream,
"%d vtable entries", len - 1);
173 if (elttype->
code () == TYPE_CODE_FUNC)
188 if (((elttype->
length () == 1
189 && (elttype->
code () == TYPE_CODE_INT
190 || elttype->
code () == TYPE_CODE_CHAR))
191 || ((elttype->
length () == 2 || elttype->
length () == 4)
192 && elttype->
code () == TYPE_CODE_CHAR))
207 &string_pos, &char_type, NULL) > 0
210 ULONGEST string_length;
215 buffer = (gdb_byte *)
xmalloc (length_size);
216 read_memory (addr + length_pos, buffer, length_size);
221 addr + string_pos, string_length,
233 && (msymbol.
minsym != NULL)
245 struct value *vt_val;
246 struct symbol *wsym = NULL;
252 if (msymbol.
minsym != NULL)
261 wtype = wsym->
type ();
267 vt_val =
value_at (wtype, vt_address);
282 case TYPE_CODE_FLAGS:
284 case TYPE_CODE_RANGE:
288 case TYPE_CODE_ERROR:
295 case TYPE_CODE_UNION:
302 case TYPE_CODE_STRUCT:
320 &string_pos, &char_type, NULL) > 0)
323 length_size, byte_order);
324 printstr (stream, char_type, valaddr + string_pos, len,
344 LONGEST low_bound, high_bound;
351 if (low_bound == 0 && high_bound == -1 &&
type->
length () > 0)
356 high_bound =
type->
length () * TARGET_CHAR_BIT - 1;
357 range->bounds ()->high.set_const_val (high_bound);
366 for (i = low_bound; i <= high_bound; i++)
373 goto maybe_bad_bstring;
382 if (i + 1 <= high_bound
388 while (i + 1 <= high_bound
401 error (_(
"Invalid pascal type code %d in symbol table."),
414 opts.deref_ref =
true;
449 gdb_printf (file, _(
"Printing of pascal static members is %s.\n"),
466{
'_',
'_',
'v',
't',
'b',
'l',
'_',
'p',
't',
'r',
'_',
't',
'y',
'p',
'e', 0};
474 const char *type_name =
type->
name ();
476 return (type_name != NULL
489 if (
type->
code () == TYPE_CODE_ARRAY)
492 if (
type->
code () == TYPE_CODE_STRUCT
517 struct type **dont_print_vb,
518 int dont_print_statmem)
520 int i, len, n_baseclasses;
521 char *last_dont_print
532 if (n_baseclasses > 0)
534 options, dont_print_vb);
536 if (!len && n_baseclasses == 1)
544 if (dont_print_statmem == 0)
552 for (i = n_baseclasses; i < len; i++)
560 else if (n_baseclasses > 0)
591 DMGL_PARAMS | DMGL_ANSI);
625 opts.deref_ref =
false;
655 opts.deref_ref =
false;
666 if (dont_print_statmem == 0)
690 struct type **dont_print_vb)
692 struct type **last_dont_print
698 if (dont_print_vb == 0)
707 for (i = 0; i < n_baseclasses; i++)
711 const char *basename = baseclass->
name ();
716 struct type **first_dont_print
723 if (baseclass == first_dont_print[j])
729 struct value *base_value;
734 catch (
const gdb_exception_error &ex)
736 base_value =
nullptr;
737 if (ex.error == NOT_AVAILABLE_ERROR)
749 if (boffset < 0 || boffset >=
type->
length ())
752 gdb::byte_vector buf (baseclass->
length ());
755 baseclass->
length ()) != 0)
760 baseclass = base_value->
type ();
774 gdb_puts (basename ? basename :
"", stream);
783 (base_value, stream, recurse, options,
792 if (dont_print_vb == 0)
827 if (
type->
code () == TYPE_CODE_STRUCT)
829 CORE_ADDR *first_dont_print, addr;
839 if (val->
address () == first_dont_print[i])
842<same as static member of an already seen type>"),
859 opts.deref_ref =
false;
869Set printing of pascal static members."), _(
"\
870Show printing of pascal static members."), NULL,
void annotate_field_value(void)
void annotate_field_begin(struct type *type)
void annotate_field_name_end(void)
void annotate_field_end(void)
static void print_unpacked_pointer(struct type *type, struct type *elttype, struct type *unresolved_elttype, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value_print_options *options)
ui_file_style style() const
void value_print_inner(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options) const override
void printstr(struct ui_file *stream, struct type *elttype, const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, const struct value_print_options *options) const override
void value_print(struct value *val, struct ui_file *stream, const struct value_print_options *options) const override
virtual void wrap_here(int indent)
struct cmd_list_element * showprintlist
struct cmd_list_element * setprintlist
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
cli_style_option variable_name_style
cli_style_option metadata_style
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
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)
bool get_discrete_bounds(struct type *type, LONGEST *lowp, LONGEST *highp)
bool get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
struct type * check_typedef(struct type *type)
#define TYPE_BASECLASS(thistype, index)
#define TYPE_FIELD_IGNORE(thistype, n)
#define BASETYPE_VIA_VIRTUAL(thistype, index)
#define TYPE_N_BASECLASSES(thistype)
const struct language_defn * current_language
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
int pascal_object_is_vtbl_ptr_type(struct type *)
int pascal_is_string_type(struct type *type, int *length_pos, int *length_size, int *string_pos, struct type **char_type, const char **arrayname)
int pascal_object_is_vtbl_member(struct type *)
static const struct generic_val_print_decorations p_decorations
static void show_pascal_static_field_print(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void pascal_object_print_value_fields(struct value *, struct ui_file *, int, const struct value_print_options *, struct type **, int)
static void pascal_object_print_static_field(struct value *, struct ui_file *, int, const struct value_print_options *)
static struct obstack dont_print_vb_obstack
static struct obstack dont_print_statmem_obstack
static void pascal_object_print_value(struct value *, struct ui_file *, int, const struct value_print_options *, struct type **)
int pascal_object_is_vtbl_ptr_type(struct type *type)
int pascal_object_is_vtbl_member(struct type *type)
const char pascal_vtbl_ptr_name[]
void _initialize_pascal_valprint()
int print_address_demangle(const struct value_print_options *opts, struct gdbarch *gdbarch, CORE_ADDR addr, struct ui_file *stream, int do_demangle)
CORE_ADDR value_address() const
struct minimal_symbol * minsym
LONGEST loc_bitpos() const
const char * name() const
unsigned int bitsize() const
struct type * type() const
const char * print_name() const
const char * search_name() const
enum language la_language
struct type * type() const
struct type * target_type() const
struct field & field(int idx) const
unsigned int num_fields() const
const char * name() const
type * index_type() const
enum val_prettyformat prettyformat
bool pascal_static_field_print
struct value * primitive_field(LONGEST offset, int fieldno, struct type *arg_type)
struct type * type() const
bool entirely_optimized_out()
bool bits_synthetic_pointer(LONGEST offset, LONGEST length) const
gdb::array_view< const gdb_byte > contents_for_printing()
struct block_symbol lookup_symbol_search_name(const char *search_name, const struct block *block, domain_enum domain)
#define VTBL_FNADDR_OFFSET
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
void print_type_scalar(struct type *type, LONGEST val, struct ui_file *stream)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void print_spaces(int n, struct ui_file *stream)
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 fprintf_symbol(struct ui_file *stream, const char *name, enum language lang, int arg_mode)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
int value_bit_index(struct type *type, const gdb_byte *valaddr, int index)
struct value * value_at(struct type *type, CORE_ADDR addr)
void generic_value_print(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct generic_val_print_decorations *decorations)
void value_print_scalar_formatted(struct value *val, const struct value_print_options *options, int size, struct ui_file *stream)
void val_print_unavailable(struct ui_file *stream)
void val_print_optimized_out(const struct value *val, struct ui_file *stream)
void val_print_invalid_address(struct ui_file *stream)
int val_print_string(struct type *elttype, const char *encoding, CORE_ADDR addr, int len, struct ui_file *stream, const struct value_print_options *options)
void value_print_array_elements(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, unsigned int i)
void common_val_print(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
struct value_print_options user_print_options
static unsigned int get_print_max_chars(const struct value_print_options *options)
CORE_ADDR unpack_pointer(struct type *type, const gdb_byte *valaddr)
struct value * value_field_bitfield(struct type *type, int fieldno, const gdb_byte *valaddr, LONGEST embedded_offset, const struct value *val)
struct value * value_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, frame_info_ptr frame)