33#include "gdbsupport/gdb_obstack.h"
38#include "gdbsupport/byte-vector.h"
42#include "count-one-bits.h"
46#include "gdbsupport/selftest.h"
54#define WCHAR_BUFLEN(X) ((X) * sizeof (gdb_wchar_t))
57#define WCHAR_BUFLEN_MAX WCHAR_BUFLEN (MAX_WCHARS)
93 struct value *original_value,
97#define PRINT_MAX_DEFAULT 200
98#define PRINT_MAX_DEPTH_DEFAULT 20
157 _(
"Limit on string chars or array "
158 "elements to print is %s.\n"),
171 _(
"Default input radix for entering numbers is %s.\n"),
181 _(
"Default output radix for printing of values is %s.\n"),
203 gdb_printf (file, _(
"Threshold for repeated print elements is %s.\n"),
214 _(
"Printing of memory tag violations is %s.\n"),
225 _(
"Printing of char arrays to stop "
226 "at first null char is %s.\n"),
236 gdb_printf (file, _(
"Pretty formatting of structures is %s.\n"),
value);
256 _(
"Printing of unions interior to structures is %s.\n"),
267 _(
"Printing binary values in groups is %s.\n"),
285 _(
"Printing of symbols when printing pointers is %s.\n"),
306 case TYPE_CODE_ARRAY:
307 case TYPE_CODE_STRUCT:
308 case TYPE_CODE_UNION:
310 case TYPE_CODE_STRING:
334 LONGEST embedded_offset,
335 const struct value *val)
351 if (
type->
code () != TYPE_CODE_UNION
352 &&
type->
code () != TYPE_CODE_STRUCT
353 &&
type->
code () != TYPE_CODE_ARRAY)
356 TARGET_CHAR_BIT * embedded_offset,
366 const int is_ref =
type->
code () == TYPE_CODE_REF;
367 int ref_is_addressable = 0;
373 if (deref_val != NULL)
377 if (!is_ref || !ref_is_addressable)
436 if (elttype->
code () == TYPE_CODE_FUNC)
453 struct ui_file *stream,
int recurse,
464 LONGEST low_bound, high_bound;
467 error (_(
"Could not determine the array high bound"));
507 int embedded_offset,
struct ui_file *stream)
511 if (address_buffer != NULL)
525static const gdb_byte *
528 gdb_assert (deref_val != NULL);
543 int embedded_offset,
struct ui_file *stream,
int recurse,
544 struct value *original_value,
548 struct value *deref_val = NULL;
549 const int value_is_synthetic
553 const int must_coerce_ref = ((options->
addressprint && value_is_synthetic)
558 if (must_coerce_ref && type_is_defined)
562 if (deref_val != NULL)
585 const gdb_byte *
address = (value_is_synthetic && type_is_defined
616 for (i = 0; i < len; i++)
637 for (i = 0; i < len; ++i)
642 int nbits = count_one_bits_ll (enumval);
644 gdb_assert (nbits == 0 || nbits == 1);
646 if ((val & enumval) != 0)
695 struct value *original_value,
702 gdb_assert (!options->
format);
715 int embedded_offset, CORE_ADDR address,
717 struct value *original_value,
722 gdb_assert (!options->
format);
798 gdb_printf (stream,
"%u", (
unsigned int) val);
810 struct value *original_value,
813 gdb_assert (!options->
format);
835 f.read_fixed_point (gdb::make_array_view (valaddr,
type->
length ()),
839 const char *fmt =
type->
length () < 4 ?
"%.11Fg" :
"%.17Fg";
901 while (
type->
code () == TYPE_CODE_RANGE)
909 case TYPE_CODE_ARRAY:
913 case TYPE_CODE_MEMBERPTR:
923 case TYPE_CODE_RVALUE_REF:
935 case TYPE_CODE_FLAGS:
943 case TYPE_CODE_METHOD:
964 case TYPE_CODE_DECFLOAT:
971 case TYPE_CODE_FIXED_POINT:
979 case TYPE_CODE_ERROR:
990 case TYPE_CODE_COMPLEX:
994 case TYPE_CODE_METHODPTR:
999 case TYPE_CODE_UNION:
1000 case TYPE_CODE_STRUCT:
1002 error (_(
"Unhandled type code %d in symbol table."),
1073 language->value_print_inner (
value, stream, recurse, &local_opts);
1075 catch (
const gdb_exception_error &except)
1078 _(
"<error reading variable: %s>"), except.what ());
1091 gdb_assert (
language->struct_too_deep_ellipsis () != NULL);
1110 _(
"<address of value unknown>"));
1135 _(
"<internal function %s>"),
1198void ATTRIBUTE_UNUSED
1207 int embedded_offset,
struct ui_file *stream)
1223 if (field_type == bool_type
1241 if (field_len <
sizeof (ULONGEST) * TARGET_CHAR_BIT)
1242 field_val &= ((ULONGEST) 1 << field_len) - 1;
1246 if (field_type->
code () == TYPE_CODE_ENUM)
1266 gdb_assert (val != NULL);
1271 if (options->
format ==
's')
1324 val = int_string (val_long, 10, 1, 0, 1);
break;
1326 val = int_string (val_long, 10, 0, 0, 1);
break;
1328 val = int_string (val_long, 16, 0, 0, use_c_format);
break;
1330 val = int_string (val_long, 16, 0, 2, 1);
break;
1332 val = int_string (val_long, 16, 0, 4, 1);
break;
1334 val = int_string (val_long, 16, 0, 8, 1);
break;
1336 val = int_string (val_long, 16, 0, 16, 1);
break;
1339 val = int_string (val_long, 8, 0, 0, use_c_format);
break;
1341 internal_error (_(
"failed internal consistency check"));
1356 int rtnval = (int) arg;
1359 if (
sizeof (LONGEST) >
sizeof (int))
1363 error (_(
"Value out of range."));
1382 unsigned len,
enum bfd_endian byte_order,
bool zero_pad,
1388 bool seen_a_one =
false;
1389 const char *digit_separator =
nullptr;
1394 const int mask = 0x080;
1399 if (byte_order == BFD_ENDIAN_BIG)
1408 for (i = 0; i < (HOST_CHAR_BIT *
sizeof (*p)); i++)
1411 gdb_putc (*digit_separator, stream);
1413 if (*p & (mask >> i))
1418 if (zero_pad || seen_a_one || b ==
'1')
1422 if ((0xf0 & (mask >> i) && (*p & 0xf0))
1423 || (0x0f & (mask >> i) && (*p & 0x0f)))
1434 for (p = valaddr + len - 1;
1438 for (i = 0; i < (HOST_CHAR_BIT *
sizeof (*p)); i++)
1441 gdb_putc (*digit_separator, stream);
1443 if (*p & (mask >> i))
1448 if (zero_pad || seen_a_one || b ==
'1')
1452 if ((0xf0 & (mask >> i) && (*p & 0xf0))
1453 || (0x0f & (mask >> i) && (*p & 0x0f)))
1465 if (!zero_pad && !seen_a_one)
1475 if (*seen_a_one || digit != 0)
1486 unsigned len,
enum bfd_endian byte_order)
1489 unsigned char octa1, octa2, octa3, carry;
1507#define BITS_IN_OCTAL 3
1508#define HIGH_ZERO 0340
1509#define LOW_ZERO 0034
1510#define CARRY_ZERO 0003
1512 "cycle zero constants are wrong");
1513#define HIGH_ONE 0200
1516#define CARRY_ONE 0001
1518 "cycle one constants are wrong");
1519#define HIGH_TWO 0300
1523 "cycle two constants are wrong");
1532 bool seen_a_one =
false;
1533 if (byte_order == BFD_ENDIAN_BIG)
1554 octa1 = (carry << 1) | ((
HIGH_ONE & *p) >> 7);
1566 octa1 = (carry << 2) | ((
HIGH_TWO & *p) >> 6);
1576 error (_(
"Internal error in octal conversion;"));
1585 for (p = valaddr + len - 1;
1604 octa1 = (carry << 1) | ((
HIGH_ONE & *p) >> 7);
1616 octa1 = (carry << 2) | ((
HIGH_TWO & *p) >> 6);
1626 error (_(
"Internal error in octal conversion;"));
1643 enum bfd_endian byte_order,
1644 gdb::byte_vector *out_vec)
1647 gdb_assert (len > 0);
1648 if (byte_order == BFD_ENDIAN_BIG)
1649 sign_byte = bytes[0];
1651 sign_byte = bytes[len - 1];
1652 if ((sign_byte & 0x80) == 0)
1655 out_vec->resize (len);
1658 if (byte_order == BFD_ENDIAN_LITTLE)
1661 for (
unsigned i = 0; i < len; ++i)
1663 unsigned tem = (0xff & ~bytes[i]) + carry;
1664 (*out_vec)[i] = tem & 0xff;
1671 for (
unsigned i = len; i > 0; --i)
1673 unsigned tem = (0xff & ~bytes[i - 1]) + carry;
1674 (*out_vec)[i - 1] = tem & 0xff;
1687 unsigned len,
bool is_signed,
1688 enum bfd_endian byte_order)
1691#define CARRY_OUT( x ) ((x) / TEN)
1692#define CARRY_LEFT( x ) ((x) % TEN)
1693#define SHIFT( x ) ((x) << 4)
1694#define LOW_NIBBLE( x ) ( (x) & 0x00F)
1695#define HIGH_NIBBLE( x ) (((x) & 0x0F0) >> 4)
1700 int i, j, decimal_digits;
1704 gdb::byte_vector negated_bytes;
1709 valaddr = negated_bytes.data ();
1715 decimal_len = len * 2 * 2;
1716 std::vector<unsigned char> digits (decimal_len, 0);
1732 p = (byte_order == BFD_ENDIAN_BIG) ? valaddr : valaddr + len - 1;
1734 while ((byte_order == BFD_ENDIAN_BIG) ? (p < valaddr + len) : (p >= valaddr))
1741 for (j = 0; j < decimal_digits; j++)
1743 digits[j] =
SHIFT (digits[j]);
1764 if (byte_order == BFD_ENDIAN_BIG)
1780 for (j = 0; j < decimal_len - 1; j++)
1792 if (j >= decimal_digits && carry == 0)
1801 decimal_digits = j + 1;
1810 for (i = decimal_digits - 1; i > 0 && digits[i] == 0; --i)
1823 unsigned len,
enum bfd_endian byte_order,
1829 if (byte_order == BFD_ENDIAN_BIG)
1837 for (; p < valaddr + len - 1 && !*p; ++p)
1841 const gdb_byte *first = p;
1848 if (!zero_pad && p == first)
1856 p = valaddr + len - 1;
1862 for (; p >= valaddr + 1 && !*p; --p)
1866 const gdb_byte *first = p;
1873 if (!zero_pad && p == first)
1927 unsigned int things_printed = 0;
1935 LONGEST low_bound, high_bound;
1954 if (low_bound > high_bound)
1957 len = high_bound - low_bound + 1;
1961 warning (_(
"unable to get bounds of array, assuming null array"));
1968 for (; i < len && things_printed < options->
print_max; i++)
2002 struct value *rep_elt
2019 gdb_printf (stream,
" %p[<repeats %u times>%p]",
2049 || w ==
LCST (
'\a') || w ==
LCST (
'\b')
2050 || w ==
LCST (
'\f') || w ==
LCST (
'\n')
2051 || w ==
LCST (
'\r') || w ==
LCST (
'\t')
2052 || w ==
LCST (
'\v'));
2060 struct obstack *output)
2062 for (; *string; ++string)
2080 int orig_len,
int width,
2081 enum bfd_endian byte_order,
2082 struct obstack *output,
2083 int quoter,
bool *need_escapep)
2085 bool need_escape = *need_escapep;
2087 *need_escapep =
false;
2094 obstack_grow_wstr (output,
LCST (
"\\a"));
2097 obstack_grow_wstr (output,
LCST (
"\\b"));
2100 obstack_grow_wstr (output,
LCST (
"\\f"));
2103 obstack_grow_wstr (output,
LCST (
"\\n"));
2106 obstack_grow_wstr (output,
LCST (
"\\r"));
2109 obstack_grow_wstr (output,
LCST (
"\\t"));
2112 obstack_grow_wstr (output,
LCST (
"\\v"));
2121 obstack_grow_wstr (output,
LCST (
"\\"));
2122 obstack_grow (output, &wchar,
sizeof (
gdb_wchar_t));
2128 for (i = 0; i + width <= orig_len; i += width)
2139 xsnprintf (octal,
sizeof (octal),
"\\%.3o",
2140 (
int) (
value & 0777));
2141 *need_escapep =
false;
2145 xsnprintf (octal,
sizeof (octal),
"\\x%lx", (
long)
value);
2149 *need_escapep =
true;
2154 while (i < orig_len)
2158 xsnprintf (octal,
sizeof (octal),
"\\%.3o", orig[i] & 0xff);
2159 *need_escapep =
false;
2175 int quoter,
const char *encoding)
2177 enum bfd_endian byte_order
2180 bool need_escape =
false;
2182 c_buf = (gdb_byte *) alloca (
type->
length ());
2188 auto_obstack wchar_buf;
2194 const gdb_byte *buf;
2196 int print_escape = 1;
2199 num_chars = iter.
iterate (&result, &chars, &buf, &buflen);
2212 for (i = 0; i < num_chars; ++i)
2221 for (i = 0; i < num_chars; ++i)
2224 &wchar_buf, quoter, &need_escape);
2231 byte_order, &wchar_buf, quoter, &need_escape);
2235 auto_obstack output;
2238 (gdb_byte *) obstack_base (&wchar_buf),
2239 obstack_object_size (&wchar_buf),
2241 obstack_1grow (&output,
'\0');
2243 gdb_puts ((
const char *) obstack_base (&output), stream);
2251 std::vector<converted_character> *vec)
2267 vec->push_back (tmp);
2270 current = &vec->back ();
2313 && memcmp (current->
buf, d.
buf, current->
buflen) == 0))
2336 const std::vector<converted_character> &
chars,
2337 int quote_char,
int width,
2338 enum bfd_endian byte_order,
2343 enum {START,
SINGLE, REPEAT, INCOMPLETE, FINISH} state, last;
2345 bool need_escape =
false;
2349 last = state = START;
2372 obstack_grow_wstr (obstack,
LCST (
", "));
2373 obstack_grow (obstack, &wide_quote_char,
sizeof (
gdb_wchar_t));
2380 byte_order, obstack, quote_char, &need_escape);
2383 byte_order, obstack, quote_char, &need_escape);
2399 obstack_grow (obstack, &wide_quote_char,
sizeof (
gdb_wchar_t));
2402 obstack_grow_wstr (obstack,
LCST (
", "));
2405 obstack_grow_wstr (obstack,
LCST (
"'"));
2408 byte_order, obstack, quote_char, &need_escape);
2411 byte_order, obstack, quote_char, &need_escape);
2412 obstack_grow_wstr (obstack,
LCST (
"'"));
2413 std::string s = string_printf (_(
" <repeats %u times>"),
2415 for (j = 0; s[j]; ++j)
2429 obstack_grow (obstack, &wide_quote_char,
sizeof (
gdb_wchar_t));
2432 obstack_grow_wstr (obstack,
LCST (
", "));
2435 obstack_grow_wstr (obstack,
LCST (
"<incomplete sequence "));
2437 obstack, 0, &need_escape);
2438 obstack_grow_wstr (obstack,
LCST (
">"));
2449 obstack_grow (obstack, &wide_quote_char,
sizeof (
gdb_wchar_t));
2456 if (state != FINISH)
2458 elem = &
chars[idx++];
2493 const gdb_byte *
string,
unsigned int length,
2494 const char *encoding,
int force_ellipses,
2495 int quote_char,
int c_style_terminator,
2506 unsigned long current_char = 1;
2508 for (i = 0; current_char; ++i)
2520 if (c_style_terminator
2524 width, byte_order) == 0))
2529 gdb_printf (stream,
"%c%c", quote_char, quote_char);
2535 std::vector<converted_character> converted_chars;
2540 while (i < options->print_max)
2560 last = &converted_chars.back ();
2568 auto_obstack wchar_buf;
2572 width, byte_order, options);
2574 if (force_ellipses || !finished)
2575 obstack_grow_wstr (&wchar_buf,
LCST (
"..."));
2578 auto_obstack output;
2581 (gdb_byte *) obstack_base (&wchar_buf),
2582 obstack_object_size (&wchar_buf),
2584 obstack_1grow (&output,
'\0');
2586 gdb_puts ((
const char *) obstack_base (&output), stream);
2599 CORE_ADDR addr,
int len,
2603 int force_ellipsis = 0;
2606 unsigned int fetchlimit;
2608 gdb::unique_xmalloc_ptr<gdb_byte> buffer;
2611 int width = elttype->
length ();
2621 fetchlimit = (len == -1 ? options->
print_max : std::min ((
unsigned) len,
2625 &buffer, &bytes_read);
2635 if (bytes_read >= width)
2637 width, byte_order) == 0;
2638 if (len == -1 && !found_nul)
2646 peekbuf = (gdb_byte *) alloca (width);
2652 else if ((len >= 0 &&
err != 0) || (len > bytes_read / width))
2663 if (
err == 0 || bytes_read > 0)
2666 encoding, force_ellipsis, options);
2677 return (bytes_read / width);
2719 error (_(
"Nonsense input radix ``decimal %u''; input radix unchanged."),
2726 "decimal %u, hex %x, octal %o.\n"),
2727 radix, radix, radix);
2761 error (_(
"Unsupported output radix ``decimal %u''; "
2762 "output radix unchanged."),
2769 "decimal %u, hex %x, octal %o.\n"),
2770 radix, radix, radix);
2792 gdb_printf (_(
"Input and output radices now set to "
2793 "decimal %u, hex %x, octal %o.\n"),
2794 radix, radix, radix);
2807 gdb_printf (_(
"Input and output radices set to "
2808 "decimal %u, hex %x, octal %o.\n"),
2814 "%u, hex %x, octal %o.\n"),
2817 "%u, hex %x, octal %o.\n"),
2830Printing of C++ virtual function tables is %s.\n"),
2842Printing of object's derived type based on vtable info is %s.\n"),
2852 _(
"Printing of C++ static members is %s.\n"),
2875 N_(
"Set printing of addresses."),
2876 N_(
"Show printing of addresses."),
2884 N_(
"Set pretty formatting of arrays."),
2885 N_(
"Show pretty formatting of arrays."),
2893 N_(
"Set printing of array indexes."),
2894 N_(
"Show printing of array indexes."),
2902 N_(
"Set whether to print binary values in groups of four bits."),
2903 N_(
"Show whether to print binary values in groups of four bits."),
2911 N_(
"Set limit on string chars or array elements to print."),
2912 N_(
"Show limit on string chars or array elements to print."),
2913 N_(
"\"unlimited\" causes there to be no limit."),
2920 N_(
"Set maximum print depth for nested structures, unions and arrays."),
2921 N_(
"Show maximum print depth for nested structures, unions, and arrays."),
2922 N_(
"When structures, unions, or arrays are nested beyond this depth then they\n\
2923will be replaced with either '{...}' or '(...)' depending on the language.\n\
2924Use \"unlimited\" to print the complete structure.")
2928 "memory-tag-violations",
2931 N_(
"Set printing of memory tag violations for pointers."),
2932 N_(
"Show printing of memory tag violations for pointers."),
2933 N_(
"Issue a warning when the printed value is a pointer\n\
2934whose logical tag doesn't match the allocation tag of the memory\n\
2935location it points to."),
2942 N_(
"Set printing of char arrays to stop at first null char."),
2943 N_(
"Show printing of char arrays to stop at first null char."),
2951 _(
"Set printing of C++ virtual function tables."),
2952 _(
"Show printing of C++ virtual function tables."),
2960 N_(
"Set pretty formatting of structures."),
2961 N_(
"Show pretty formatting of structures."),
2969 N_(
"Set whether to print values in raw form."),
2970 N_(
"Show whether to print values in raw form."),
2971 N_(
"If set, values are printed in raw form, bypassing any\n\
2972pretty-printers for that value.")
2979 N_(
"Set threshold for repeated print elements."),
2980 N_(
"Show threshold for repeated print elements."),
2981 N_(
"\"unlimited\" causes all elements to be individually printed."),
2988 N_(
"Set printing of C++ static members."),
2989 N_(
"Show printing of C++ static members."),
2997 N_(
"Set printing of symbol names when printing pointers."),
2998 N_(
"Show printing of symbol names when printing pointers."),
3006 N_(
"Set printing of unions interior to structures."),
3007 N_(
"Show printing of unions interior to structures."),
3015 N_(
"Set printing of C++ virtual function tables."),
3016 N_(
"Show printing of C++ virtual function tables."),
3034test_print_flags (
gdbarch *arch)
3051 SELF_CHECK (out.
string () ==
"[ A=2 B=1 C=5 ]");
3066 _(
"Generic command for setting how things print."),
3067 _(
"Generic command for showing print settings."),
3079 _(
"Generic command for setting what things to print in \"raw\" mode."),
3080 _(
"Generic command for showing \"print raw\" settings."),
3091Set default input radix for entering numbers."), _(
"\
3092Show default input radix for entering numbers."), NULL,
3099Set default output radix for printing of values."), _(
"\
3100Show default output radix for printing of values."), NULL,
3113Set default input and output number radices.\n\
3114Use 'set input-radix' or 'set output-radix' to independently set each.\n\
3115Without an argument, sets both radices back to the default value of 10."),
3118Show the default input and output number radices.\n\
3119Use 'show input-radix' or 'show output-radix' to independently show each."),
struct value * ada_to_fixed_value(struct value *val)
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 cp_print_class_member(const gdb_byte *, struct type *, struct ui_file *, const char *)
const char * host_charset(void)
void convert_between_encodings(const char *from, const char *to, const gdb_byte *bytes, unsigned int num_bytes, int width, struct obstack *output, enum transliterations translit)
@ wchar_iterate_incomplete
ui_file_style style() const
const std::string & string()
virtual void wrap_here(int indent)
int iterate(enum wchar_iterate_result *out_result, gdb_wchar_t **out_chars, const gdb_byte **ptr, size_t *len)
struct cmd_list_element * showlist
struct cmd_list_element * showprintlist
struct cmd_list_element * setprintlist
struct cmd_list_element * setlist
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *target, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
struct cmd_list_element * deprecate_cmd(struct cmd_list_element *cmd, const char *replacement)
set_show_commands add_setshow_prefix_cmd(const char *name, command_class theclass, const char *set_doc, const char *show_doc, cmd_list_element **set_subcommands_list, cmd_list_element **show_subcommands_list, cmd_list_element **set_list, cmd_list_element **show_list)
set_show_commands add_setshow_zuinteger_cmd(const char *name, enum command_class theclass, unsigned int *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
std::string memory_error_message(enum target_xfer_status err, struct gdbarch *gdbarch, CORE_ADDR memaddr)
void cplus_print_method_ptr(const gdb_byte *contents, struct type *type, struct ui_file *stream)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
@ Val_prettyformat_default
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)
LONGEST parse_and_eval_long(const char *exp)
int apply_ext_lang_val_pretty_printer(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
#define INTERMEDIATE_ENCODING
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
enum bfd_endian type_byte_order(const struct type *type)
struct type * arch_flags_type(struct gdbarch *gdbarch, const char *name, int bit)
void append_flags_type_field(struct type *type, int start_bitpos, int nr_bits, struct type *field_type, const char *name)
bool get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
int type_not_associated(const struct type *type)
bool is_fixed_point_type(struct type *type)
int type_not_allocated(const struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_IS_REFERENCE(t)
void print_scalar_formatted(const gdb_byte *, struct type *, const struct value_print_options *, int, struct ui_file *)
#define TYPE_FIELD_BITSIZE(thistype, n)
#define TYPE_ERROR_NAME(type)
std::string gmp_string_printf(const char *fmt,...)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
struct inferior * current_inferior(void)
const struct language_defn * current_language
void add_setshow_cmds_for_options(command_class cmd_class, void *data, gdb::array_view< const option_def > options, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void register_test_foreach_arch(const std::string &name, self_test_foreach_arch_function *function)
int print_address_demangle(const struct value_print_options *opts, struct gdbarch *gdbarch, CORE_ADDR addr, struct ui_file *stream, int do_demangle)
struct type * builtin_bool
struct type * builtin_uint32
gdb_wchar_t chars[WCHAR_BUFLEN_MAX]
enum wchar_iterate_result result
LONGEST loc_bitpos() const
LONGEST loc_enumval() const
const char * name() const
struct type * type() const
const char * complex_suffix
const char * complex_prefix
const char * complex_infix
virtual void print_array_index(struct type *index_type, LONGEST index_value, struct ui_file *stream, const value_print_options *options) const
virtual void value_print(struct value *val, struct ui_file *stream, const struct value_print_options *options) const
virtual 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
virtual void printchar(int ch, struct type *chtype, struct ui_file *stream) const
virtual const char * get_digit_separator() const
struct type * target_type() const
struct field & field(int idx) const
ULONGEST bit_stride() const
const gdb_mpq & fixed_point_scaling_factor()
type * index_type() const
struct type * fixed_point_type_base_type()
bool is_flag_enum() const
const ui_file_style * ptr() const
enum val_prettyformat prettyformat
unsigned int repeat_count_threshold
bool prettyformat_structs
std::string target_float_to_string(const gdb_byte *addr, const struct type *type, const char *format)
int target_read_string(CORE_ADDR addr, int len, int width, unsigned int fetchlimit, gdb::unique_xmalloc_ptr< gdb_byte > *buffer, int *bytes_read)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
void val_print_not_allocated(struct ui_file *stream)
void val_print_not_associated(struct ui_file *stream)
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 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_flush(struct ui_file *stream)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
struct value * value_at(struct type *type, CORE_ADDR addr)
struct value * value_addr(struct value *arg1)
struct value * value_cast(struct type *type, struct value *arg2)
struct value * value_real_part(struct value *value)
struct value * value_imaginary_part(struct value *value)
static void show_stop_print_at_null(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void generic_value_print_ptr(struct value *val, struct ui_file *stream, const struct value_print_options *options)
static void show_repeat_count_threshold(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void get_formatted_print_options(struct value_print_options *opts, char format)
static void generic_val_print_fixed_point(struct value *val, struct ui_file *stream, const struct value_print_options *options)
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)
static void generic_value_print_bool(struct value *value, struct ui_file *stream, const struct value_print_options *options, const struct generic_val_print_decorations *decorations)
static void show_nibbles(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void set_output_radix_1(int, unsigned)
static void generic_val_print_enum_1(struct type *type, LONGEST val, struct ui_file *stream)
void value_print(struct value *val, struct ui_file *stream, const struct value_print_options *options)
static void show_print_array_indexes(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void get_no_prettyformat_print_options(struct value_print_options *opts)
void generic_emit_char(int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding)
void value_print_scalar_formatted(struct value *val, const struct value_print_options *options, int size, struct ui_file *stream)
void print_decimal_chars(struct ui_file *stream, const gdb_byte *valaddr, unsigned len, bool is_signed, enum bfd_endian byte_order)
void val_print_unavailable(struct ui_file *stream)
static void show_memory_tag_violations(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void generic_val_print_enum(struct type *type, int embedded_offset, struct ui_file *stream, struct value *original_value, const struct value_print_options *options)
void print_octal_chars(struct ui_file *stream, const gdb_byte *valaddr, unsigned len, enum bfd_endian byte_order)
static void generic_val_print_func(struct type *type, int embedded_offset, CORE_ADDR address, struct ui_file *stream, struct value *original_value, const struct value_print_options *options)
void _initialize_valprint()
int valprint_check_validity(struct ui_file *stream, struct type *type, LONGEST embedded_offset, const struct value *val)
#define PRINT_MAX_DEFAULT
static void show_addressprint(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
int val_print_scalar_type_p(struct type *type)
static bool val_print_scalar_or_string_type_p(struct type *type, const struct language_defn *language)
gdb::option::option_def_group make_value_print_options_def_group(value_print_options *opts)
static void generic_value_print_char(struct value *value, struct ui_file *stream, const struct value_print_options *options)
static void show_print_max(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void show_vtblprint(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static unsigned input_radix_1
struct cmd_list_element * showprintrawlist
static void emit_octal_digit(struct ui_file *stream, bool *seen_a_one, int digit)
void val_print_optimized_out(const struct value *val, struct ui_file *stream)
int longest_to_int(LONGEST arg)
bool val_print_check_max_depth(struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
static const gdb::option::option_def value_print_option_defs[]
static void print_unpacked_pointer(struct type *type, struct type *elttype, CORE_ADDR address, struct ui_file *stream, const struct value_print_options *options)
static void generic_value_print_complex(struct value *val, struct ui_file *stream, const struct value_print_options *options, const struct generic_val_print_decorations *decorations)
static void generic_val_print_array(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct generic_val_print_decorations *decorations)
void ATTRIBUTE_UNUSED debug_val(struct value *val)
static unsigned output_radix_1
static bool maybe_negate_by_bytes(const gdb_byte *bytes, unsigned len, enum bfd_endian byte_order, gdb::byte_vector *out_vec)
void val_print_invalid_address(struct ui_file *stream)
static void generic_value_print_int(struct value *val, struct ui_file *stream, const struct value_print_options *options)
static void print_converted_chars_to_obstack(struct obstack *obstack, const std::vector< converted_character > &chars, int quote_char, int width, enum bfd_endian byte_order, const struct value_print_options *options)
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)
#define PRINT_MAX_DEPTH_DEFAULT
static void show_output_radix(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void get_user_print_options(struct value_print_options *opts)
static void set_input_radix_1(int, unsigned)
void common_val_print_checked(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
static void show_radix(const char *arg, int from_tty)
static void show_print_max_depth(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void generic_val_print_ref(struct type *type, int embedded_offset, struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options)
static void show_static_field_print(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void set_input_radix(const char *args, int from_tty, struct cmd_list_element *c)
static void generic_val_print_float(struct type *type, struct ui_file *stream, struct value *original_value, const struct value_print_options *options)
static int value_check_printable(struct value *val, struct ui_file *stream, const struct value_print_options *options)
static void show_unionprint(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void print_hex_chars(struct ui_file *stream, const gdb_byte *valaddr, unsigned len, enum bfd_endian byte_order, bool zero_pad)
void print_floating(const gdb_byte *valaddr, struct type *type, struct ui_file *stream)
static void append_string_as_wide(const char *string, struct obstack *output)
static void print_wchar(gdb_wint_t w, const gdb_byte *orig, int orig_len, int width, enum bfd_endian byte_order, struct obstack *output, int quoter, bool *need_escapep)
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)
static int wchar_printable(gdb_wchar_t w)
void common_val_print(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
static void set_output_radix(const char *args, int from_tty, struct cmd_list_element *c)
void print_function_pointer_address(const struct value_print_options *options, struct gdbarch *gdbarch, CORE_ADDR address, struct ui_file *stream)
static void show_prettyformat_arrays(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void val_print_type_code_flags(struct type *type, struct value *original_value, int embedded_offset, struct ui_file *stream)
void print_binary_chars(struct ui_file *stream, const gdb_byte *valaddr, unsigned len, enum bfd_endian byte_order, bool zero_pad, const struct value_print_options *options)
struct value_print_options user_print_options
void maybe_print_array_index(struct type *index_type, LONGEST index, struct ui_file *stream, const struct value_print_options *options)
static void show_input_radix(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void print_ref_address(struct type *type, const gdb_byte *address_buffer, int embedded_offset, struct ui_file *stream)
static const gdb_byte * get_value_addr_contents(struct value *deref_val)
static void set_radix(const char *arg, int from_tty)
struct cmd_list_element * setprintrawlist
static int count_next_character(wchar_iterator *iter, std::vector< converted_character > *vec)
void val_print_not_saved(struct ui_file *stream)
void generic_printstr(struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options)
static void show_objectprint(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void show_symbol_print(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void show_prettyformat_structs(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void generic_value_print_memberptr(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct generic_val_print_decorations *decorations)
int value_bytes_available(const struct value *value, LONGEST offset, LONGEST length)
struct type * value_type(const struct value *value)
int value_entirely_optimized_out(struct value *value)
struct value * coerce_ref_if_computed(const struct value *arg)
int value_lazy(const struct value *value)
gdb::array_view< const gdb_byte > value_contents_for_printing_const(const struct value *value)
struct value * allocate_value(struct type *type)
CORE_ADDR unpack_pointer(struct type *type, const gdb_byte *valaddr)
void value_fetch_lazy(struct value *val)
struct value * value_from_component_bitsize(struct value *whole, struct type *type, LONGEST bit_offset, LONGEST bit_length)
CORE_ADDR value_address(const struct value *value)
gdb::array_view< gdb_byte > value_contents_writeable(struct value *value)
int value_bits_any_optimized_out(const struct value *value, int bit_offset, int bit_length)
const char * value_internal_function_name(struct value *val)
bool value_contents_eq(const struct value *val1, LONGEST offset1, const struct value *val2, LONGEST offset2, LONGEST length)
enum lval_type value_lval_const(const struct value *value)
void pack_long(gdb_byte *buf, struct type *type, LONGEST num)
gdb::array_view< const gdb_byte > value_contents_for_printing(struct value *value)
int value_bits_synthetic_pointer(const struct value *value, LONGEST offset, LONGEST length)
int value_entirely_unavailable(struct value *value)
LONGEST unpack_long(struct type *type, const gdb_byte *valaddr)