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,
98#define PRINT_MAX_DEFAULT 200
101#define PRINT_MAX_CHARS_DEFAULT PRINT_MAX_CHARS_ELEMENTS
104#define PRINT_MAX_DEPTH_DEFAULT 20
168 ? _(
"Limit on array elements to print is %s.\n")
169 : _(
"Limit on string chars or array elements to print is %s.\n")),
180 _(
"Limit on string characters to print is %s.\n"),
192 _(
"Default input radix for entering numbers is %s.\n"),
202 _(
"Default output radix for printing of values is %s.\n"),
224 gdb_printf (file, _(
"Threshold for repeated print elements is %s.\n"),
235 _(
"Printing of memory tag violations is %s.\n"),
246 _(
"Printing of char arrays to stop "
247 "at first null char is %s.\n"),
257 gdb_printf (file, _(
"Pretty formatting of structures is %s.\n"),
value);
277 _(
"Printing of unions interior to structures is %s.\n"),
288 _(
"Printing binary values in groups is %s.\n"),
306 _(
"Printing of symbols when printing pointers is %s.\n"),
327 case TYPE_CODE_ARRAY:
328 case TYPE_CODE_STRUCT:
329 case TYPE_CODE_UNION:
331 case TYPE_CODE_STRING:
355 LONGEST embedded_offset,
356 const struct value *val)
372 if (
type->
code () != TYPE_CODE_UNION
373 &&
type->
code () != TYPE_CODE_STRUCT
374 &&
type->
code () != TYPE_CODE_ARRAY)
386 const int is_ref =
type->
code () == TYPE_CODE_REF;
387 int ref_is_addressable = 0;
393 if (deref_val != NULL)
397 if (!is_ref || !ref_is_addressable)
456 if (elttype->
code () == TYPE_CODE_FUNC)
473 struct ui_file *stream,
int recurse,
484 LONGEST low_bound, high_bound;
487 error (_(
"Could not determine the array high bound"));
527 int embedded_offset,
struct ui_file *stream)
531 if (address_buffer != NULL)
545static const gdb_byte *
548 gdb_assert (deref_val != NULL);
563 int embedded_offset,
struct ui_file *stream,
int recurse,
564 struct value *original_value,
568 struct value *deref_val = NULL;
569 const bool value_is_synthetic
572 const int must_coerce_ref = ((options->
addressprint && value_is_synthetic)
577 if (must_coerce_ref && type_is_defined)
581 if (deref_val != NULL)
604 const gdb_byte *
address = (value_is_synthetic && type_is_defined
635 for (i = 0; i < len; i++)
656 for (i = 0; i < len; ++i)
661 int nbits = count_one_bits_ll (enumval);
663 gdb_assert (nbits == 0 || nbits == 1);
665 if ((val & enumval) != 0)
714 struct value *original_value,
721 gdb_assert (!options->
format);
734 int embedded_offset, CORE_ADDR address,
736 struct value *original_value,
741 gdb_assert (!options->
format);
817 gdb_printf (stream,
"%u", (
unsigned int) val);
829 struct value *original_value,
832 gdb_assert (!options->
format);
858 const char *fmt =
type->
length () < 4 ?
"%.11Fg" :
"%.17Fg";
859 std::string str =
f.str (fmt);
920 while (
type->
code () == TYPE_CODE_RANGE)
928 case TYPE_CODE_ARRAY:
932 case TYPE_CODE_MEMBERPTR:
942 case TYPE_CODE_RVALUE_REF:
954 case TYPE_CODE_FLAGS:
962 case TYPE_CODE_METHOD:
983 case TYPE_CODE_DECFLOAT:
990 case TYPE_CODE_FIXED_POINT:
998 case TYPE_CODE_ERROR:
1009 case TYPE_CODE_COMPLEX:
1013 case TYPE_CODE_METHODPTR:
1018 case TYPE_CODE_UNION:
1019 case TYPE_CODE_STRUCT:
1021 error (_(
"Unhandled type code %d in symbol table."),
1092 language->value_print_inner (
value, stream, recurse, &local_opts);
1094 catch (
const gdb_exception_error &except)
1097 _(
"<error reading variable: %s>"), except.what ());
1110 gdb_assert (
language->struct_too_deep_ellipsis () != NULL);
1129 _(
"<address of value unknown>"));
1151 if (val->
type ()->
code () == TYPE_CODE_INTERNAL_FUNCTION)
1154 _(
"<internal function %s>"),
1217void ATTRIBUTE_UNUSED
1226 int embedded_offset,
struct ui_file *stream)
1242 if (field_type == bool_type
1260 if (field_len <
sizeof (ULONGEST) * TARGET_CHAR_BIT)
1261 field_val &= ((ULONGEST) 1 << field_len) - 1;
1265 if (field_type->
code () == TYPE_CODE_ENUM)
1285 gdb_assert (val != NULL);
1290 if (options->
format ==
's')
1294 opts.deref_ref =
false;
1343 val = int_string (val_long, 10, 1, 0, 1);
break;
1345 val = int_string (val_long, 10, 0, 0, 1);
break;
1347 val = int_string (val_long, 16, 0, 0, use_c_format);
break;
1349 val = int_string (val_long, 16, 0, 2, 1);
break;
1351 val = int_string (val_long, 16, 0, 4, 1);
break;
1353 val = int_string (val_long, 16, 0, 8, 1);
break;
1355 val = int_string (val_long, 16, 0, 16, 1);
break;
1358 val = int_string (val_long, 8, 0, 0, use_c_format);
break;
1360 internal_error (_(
"failed internal consistency check"));
1375 int rtnval = (int) arg;
1378 if (
sizeof (LONGEST) >
sizeof (int))
1382 error (_(
"Value out of range."));
1401 unsigned len,
enum bfd_endian byte_order,
bool zero_pad,
1407 bool seen_a_one =
false;
1408 const char *digit_separator =
nullptr;
1413 const int mask = 0x080;
1418 if (byte_order == BFD_ENDIAN_BIG)
1427 for (i = 0; i < (HOST_CHAR_BIT *
sizeof (*p)); i++)
1430 gdb_putc (*digit_separator, stream);
1432 if (*p & (mask >> i))
1437 if (zero_pad || seen_a_one || b ==
'1')
1441 if ((0xf0 & (mask >> i) && (*p & 0xf0))
1442 || (0x0f & (mask >> i) && (*p & 0x0f)))
1453 for (p = valaddr + len - 1;
1457 for (i = 0; i < (HOST_CHAR_BIT *
sizeof (*p)); i++)
1460 gdb_putc (*digit_separator, stream);
1462 if (*p & (mask >> i))
1467 if (zero_pad || seen_a_one || b ==
'1')
1471 if ((0xf0 & (mask >> i) && (*p & 0xf0))
1472 || (0x0f & (mask >> i) && (*p & 0x0f)))
1484 if (!zero_pad && !seen_a_one)
1494 if (*seen_a_one || digit != 0)
1505 unsigned len,
enum bfd_endian byte_order)
1508 unsigned char octa1, octa2, octa3, carry;
1526#define BITS_IN_OCTAL 3
1527#define HIGH_ZERO 0340
1528#define LOW_ZERO 0034
1529#define CARRY_ZERO 0003
1531 "cycle zero constants are wrong");
1532#define HIGH_ONE 0200
1535#define CARRY_ONE 0001
1537 "cycle one constants are wrong");
1538#define HIGH_TWO 0300
1542 "cycle two constants are wrong");
1551 bool seen_a_one =
false;
1552 if (byte_order == BFD_ENDIAN_BIG)
1573 octa1 = (carry << 1) | ((
HIGH_ONE & *p) >> 7);
1585 octa1 = (carry << 2) | ((
HIGH_TWO & *p) >> 6);
1595 error (_(
"Internal error in octal conversion;"));
1604 for (p = valaddr + len - 1;
1623 octa1 = (carry << 1) | ((
HIGH_ONE & *p) >> 7);
1635 octa1 = (carry << 2) | ((
HIGH_TWO & *p) >> 6);
1645 error (_(
"Internal error in octal conversion;"));
1662 enum bfd_endian byte_order,
1663 gdb::byte_vector *out_vec)
1666 gdb_assert (len > 0);
1667 if (byte_order == BFD_ENDIAN_BIG)
1668 sign_byte = bytes[0];
1670 sign_byte = bytes[len - 1];
1671 if ((sign_byte & 0x80) == 0)
1674 out_vec->resize (len);
1677 if (byte_order == BFD_ENDIAN_LITTLE)
1680 for (
unsigned i = 0; i < len; ++i)
1682 unsigned tem = (0xff & ~bytes[i]) + carry;
1683 (*out_vec)[i] = tem & 0xff;
1690 for (
unsigned i = len; i > 0; --i)
1692 unsigned tem = (0xff & ~bytes[i - 1]) + carry;
1693 (*out_vec)[i - 1] = tem & 0xff;
1706 unsigned len,
bool is_signed,
1707 enum bfd_endian byte_order)
1710#define CARRY_OUT( x ) ((x) / TEN)
1711#define CARRY_LEFT( x ) ((x) % TEN)
1712#define SHIFT( x ) ((x) << 4)
1713#define LOW_NIBBLE( x ) ( (x) & 0x00F)
1714#define HIGH_NIBBLE( x ) (((x) & 0x0F0) >> 4)
1719 int i, j, decimal_digits;
1723 gdb::byte_vector negated_bytes;
1728 valaddr = negated_bytes.data ();
1734 decimal_len = len * 2 * 2;
1735 std::vector<unsigned char> digits (decimal_len, 0);
1751 p = (byte_order == BFD_ENDIAN_BIG) ? valaddr : valaddr + len - 1;
1753 while ((byte_order == BFD_ENDIAN_BIG) ? (p < valaddr + len) : (p >= valaddr))
1760 for (j = 0; j < decimal_digits; j++)
1762 digits[j] =
SHIFT (digits[j]);
1783 if (byte_order == BFD_ENDIAN_BIG)
1799 for (j = 0; j < decimal_len - 1; j++)
1811 if (j >= decimal_digits && carry == 0)
1820 decimal_digits = j + 1;
1829 for (i = decimal_digits - 1; i > 0 && digits[i] == 0; --i)
1842 unsigned len,
enum bfd_endian byte_order,
1848 if (byte_order == BFD_ENDIAN_BIG)
1856 for (; p < valaddr + len - 1 && !*p; ++p)
1860 const gdb_byte *first = p;
1867 if (!zero_pad && p == first)
1875 p = valaddr + len - 1;
1881 for (; p >= valaddr + 1 && !*p; --p)
1885 const gdb_byte *first = p;
1892 if (!zero_pad && p == first)
1946 unsigned int things_printed = 0;
1954 LONGEST low_bound, high_bound;
1973 if (low_bound > high_bound)
1976 len = high_bound - low_bound + 1;
1980 warning (_(
"unable to get bounds of array, assuming null array"));
1987 for (; i < len && things_printed < options->
print_max; i++)
2028 struct value *rep_elt
2050 gdb_printf (stream,
" %p[<repeats %u times>%p]",
2080 || w ==
LCST (
'\a') || w ==
LCST (
'\b')
2081 || w ==
LCST (
'\f') || w ==
LCST (
'\n')
2082 || w ==
LCST (
'\r') || w ==
LCST (
'\t')
2083 || w ==
LCST (
'\v'));
2091 struct obstack *output)
2093 for (; *string; ++string)
2111 int orig_len,
int width,
2112 enum bfd_endian byte_order,
2113 struct obstack *output,
2114 int quoter,
bool *need_escapep)
2116 bool need_escape = *need_escapep;
2118 *need_escapep =
false;
2125 obstack_grow_wstr (output,
LCST (
"\\a"));
2128 obstack_grow_wstr (output,
LCST (
"\\b"));
2131 obstack_grow_wstr (output,
LCST (
"\\f"));
2134 obstack_grow_wstr (output,
LCST (
"\\n"));
2137 obstack_grow_wstr (output,
LCST (
"\\r"));
2140 obstack_grow_wstr (output,
LCST (
"\\t"));
2143 obstack_grow_wstr (output,
LCST (
"\\v"));
2152 obstack_grow_wstr (output,
LCST (
"\\"));
2153 obstack_grow (output, &wchar,
sizeof (
gdb_wchar_t));
2159 for (i = 0; i + width <= orig_len; i += width)
2170 xsnprintf (octal,
sizeof (octal),
"\\%.3o",
2171 (
int) (
value & 0777));
2172 *need_escapep =
false;
2176 xsnprintf (octal,
sizeof (octal),
"\\x%lx", (
long)
value);
2180 *need_escapep =
true;
2185 while (i < orig_len)
2189 xsnprintf (octal,
sizeof (octal),
"\\%.3o", orig[i] & 0xff);
2190 *need_escapep =
false;
2206 int quoter,
const char *encoding)
2208 enum bfd_endian byte_order
2211 bool need_escape =
false;
2213 c_buf = (gdb_byte *) alloca (
type->
length ());
2219 auto_obstack wchar_buf;
2225 const gdb_byte *buf;
2227 int print_escape = 1;
2230 num_chars = iter.
iterate (&result, &chars, &buf, &buflen);
2243 for (i = 0; i < num_chars; ++i)
2252 for (i = 0; i < num_chars; ++i)
2255 &wchar_buf, quoter, &need_escape);
2262 byte_order, &wchar_buf, quoter, &need_escape);
2266 auto_obstack output;
2269 (gdb_byte *) obstack_base (&wchar_buf),
2270 obstack_object_size (&wchar_buf),
2272 obstack_1grow (&output,
'\0');
2274 gdb_puts ((
const char *) obstack_base (&output), stream);
2282 std::vector<converted_character> *vec)
2298 vec->push_back (tmp);
2301 current = &vec->back ();
2344 && memcmp (current->
buf, d.
buf, current->
buflen) == 0))
2368 const std::vector<converted_character> &
chars,
2369 int quote_char,
int width,
2370 enum bfd_endian byte_order,
2374 unsigned int idx, num_elements;
2376 enum {START,
SINGLE, REPEAT, INCOMPLETE, FINISH} state, last;
2378 bool need_escape =
false;
2383 idx = num_elements = 0;
2384 last = state = START;
2407 obstack_grow_wstr (obstack,
LCST (
", "));
2408 obstack_grow (obstack, &wide_quote_char,
sizeof (
gdb_wchar_t));
2421 byte_order, obstack, quote_char, &need_escape);
2424 byte_order, obstack, quote_char, &need_escape);
2441 obstack_grow (obstack, &wide_quote_char,
sizeof (
gdb_wchar_t));
2444 obstack_grow_wstr (obstack,
LCST (
", "));
2447 obstack_grow_wstr (obstack,
LCST (
"'"));
2450 byte_order, obstack, quote_char, &need_escape);
2453 byte_order, obstack, quote_char, &need_escape);
2454 obstack_grow_wstr (obstack,
LCST (
"'"));
2455 std::string s = string_printf (_(
" <repeats %u times>"),
2458 for (j = 0; s[j]; ++j)
2472 obstack_grow (obstack, &wide_quote_char,
sizeof (
gdb_wchar_t));
2475 obstack_grow_wstr (obstack,
LCST (
", "));
2478 obstack_grow_wstr (obstack,
LCST (
"<incomplete sequence "));
2480 obstack, 0, &need_escape);
2481 obstack_grow_wstr (obstack,
LCST (
">"));
2493 obstack_grow (obstack, &wide_quote_char,
sizeof (
gdb_wchar_t));
2500 if (state != FINISH)
2502 elem = &
chars[idx++];
2537 const gdb_byte *
string,
unsigned int length,
2538 const char *encoding,
int force_ellipses,
2539 int quote_char,
int c_style_terminator,
2550 unsigned long current_char = 1;
2552 for (i = 0; current_char; ++i)
2564 if (c_style_terminator
2568 width, byte_order) == 0))
2573 gdb_printf (stream,
"%c%c", quote_char, quote_char);
2579 std::vector<converted_character> converted_chars;
2585 while (i < print_max_chars)
2605 last = &converted_chars.back ();
2613 auto_obstack wchar_buf;
2617 width, byte_order, options, &finished);
2619 if (force_ellipses || !finished)
2620 obstack_grow_wstr (&wchar_buf,
LCST (
"..."));
2623 auto_obstack output;
2626 (gdb_byte *) obstack_base (&wchar_buf),
2627 obstack_object_size (&wchar_buf),
2629 obstack_1grow (&output,
'\0');
2631 gdb_puts ((
const char *) obstack_base (&output), stream);
2644 CORE_ADDR addr,
int len,
2648 int force_ellipsis = 0;
2651 unsigned int fetchlimit;
2653 gdb::unique_xmalloc_ptr<gdb_byte> buffer;
2656 int width = elttype->
length ();
2667 fetchlimit = (len == -1
2669 : std::min ((
unsigned) len, print_max_chars));
2672 &buffer, &bytes_read);
2682 if (bytes_read >= width)
2684 width, byte_order) == 0;
2685 if (len == -1 && !found_nul)
2693 peekbuf = (gdb_byte *) alloca (width);
2699 else if ((len >= 0 &&
err != 0) || (len > bytes_read / width))
2710 if (
err == 0 || bytes_read > 0)
2713 encoding, force_ellipsis, options);
2724 return (bytes_read / width);
2766 error (_(
"Nonsense input radix ``decimal %u''; input radix unchanged."),
2773 "decimal %u, hex %x, octal %o.\n"),
2774 radix, radix, radix);
2808 error (_(
"Unsupported output radix ``decimal %u''; "
2809 "output radix unchanged."),
2816 "decimal %u, hex %x, octal %o.\n"),
2817 radix, radix, radix);
2839 gdb_printf (_(
"Input and output radices now set to "
2840 "decimal %u, hex %x, octal %o.\n"),
2841 radix, radix, radix);
2854 gdb_printf (_(
"Input and output radices set to "
2855 "decimal %u, hex %x, octal %o.\n"),
2861 "%u, hex %x, octal %o.\n"),
2864 "%u, hex %x, octal %o.\n"),
2877Printing of C++ virtual function tables is %s.\n"),
2889Printing of object's derived type based on vtable info is %s.\n"),
2899 _(
"Printing of C++ static members is %s.\n"),
2931 N_(
"Set printing of addresses."),
2932 N_(
"Show printing of addresses."),
2940 N_(
"Set pretty formatting of arrays."),
2941 N_(
"Show pretty formatting of arrays."),
2949 N_(
"Set printing of array indexes."),
2950 N_(
"Show printing of array indexes."),
2958 N_(
"Set whether to print binary values in groups of four bits."),
2959 N_(
"Show whether to print binary values in groups of four bits."),
2968 N_(
"Set limit on string chars to print."),
2969 N_(
"Show limit on string chars to print."),
2970 N_(
"\"elements\" causes the array element limit to be used.\n"
2971 "\"unlimited\" causes there to be no limit."),
2979 N_(
"Set limit on array elements to print."),
2980 N_(
"Show limit on array elements to print."),
2981 N_(
"\"unlimited\" causes there to be no limit.\n"
2982 "This setting also applies to string chars when \"print characters\"\n"
2983 "is set to \"elements\"."),
2991 N_(
"Set maximum print depth for nested structures, unions and arrays."),
2992 N_(
"Show maximum print depth for nested structures, unions, and arrays."),
2993 N_(
"When structures, unions, or arrays are nested beyond this depth then they\n\
2994will be replaced with either '{...}' or '(...)' depending on the language.\n\
2995Use \"unlimited\" to print the complete structure.")
2999 "memory-tag-violations",
3002 N_(
"Set printing of memory tag violations for pointers."),
3003 N_(
"Show printing of memory tag violations for pointers."),
3004 N_(
"Issue a warning when the printed value is a pointer\n\
3005whose logical tag doesn't match the allocation tag of the memory\n\
3006location it points to."),
3013 N_(
"Set printing of char arrays to stop at first null char."),
3014 N_(
"Show printing of char arrays to stop at first null char."),
3022 _(
"Set printing of C++ virtual function tables."),
3023 _(
"Show printing of C++ virtual function tables."),
3031 N_(
"Set pretty formatting of structures."),
3032 N_(
"Show pretty formatting of structures."),
3040 N_(
"Set whether to print values in raw form."),
3041 N_(
"Show whether to print values in raw form."),
3042 N_(
"If set, values are printed in raw form, bypassing any\n\
3043pretty-printers for that value.")
3051 N_(
"Set threshold for repeated print elements."),
3052 N_(
"Show threshold for repeated print elements."),
3053 N_(
"\"unlimited\" causes all elements to be individually printed."),
3060 N_(
"Set printing of C++ static members."),
3061 N_(
"Show printing of C++ static members."),
3069 N_(
"Set printing of symbol names when printing pointers."),
3070 N_(
"Show printing of symbol names when printing pointers."),
3078 N_(
"Set printing of unions interior to structures."),
3079 N_(
"Show printing of unions interior to structures."),
3087 N_(
"Set printing of C++ virtual function tables."),
3088 N_(
"Show printing of C++ virtual function tables."),
3106test_print_flags (
gdbarch *arch)
3123 SELF_CHECK (out.
string () ==
"[ A=2 B=1 C=5 ]");
3138 _(
"Generic command for setting how things print."),
3139 _(
"Generic command for showing print settings."),
3151 _(
"Generic command for setting what things to print in \"raw\" mode."),
3152 _(
"Generic command for showing \"print raw\" settings."),
3163Set default input radix for entering numbers."), _(
"\
3164Show default input radix for entering numbers."), NULL,
3171Set default output radix for printing of values."), _(
"\
3172Show default output radix for printing of values."), NULL,
3185Set default input and output number radices.\n\
3186Use 'set input-radix' or 'set output-radix' to independently set each.\n\
3187Without an argument, sets both radices back to the default value of 10."),
3190Show the default input and output number radices.\n\
3191Use '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
const literal_def pinteger_unlimited_literals[]
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)
const literal_def uinteger_unlimited_literals[]
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)
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)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
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_ERROR_NAME(type)
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
unsigned int bitsize() const
struct type * type() const
void read_fixed_point(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order, bool unsigned_p, const gdb_mpq &scaling_factor)
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
unsigned int num_fields() 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
unsigned int print_max_chars
bool prettyformat_structs
bool bits_any_optimized_out(int bit_offset, int bit_length) const
gdb::array_view< gdb_byte > contents_writeable()
static struct value * allocate(struct type *type)
bool bytes_available(LONGEST offset, ULONGEST length) const
struct value * from_component_bitsize(struct type *type, LONGEST bit_offset, LONGEST bit_length)
bool entirely_unavailable()
LONGEST embedded_offset() const
bool entirely_available()
struct type * type() const
bool entirely_optimized_out()
bool contents_eq(LONGEST offset1, const struct value *val2, LONGEST offset2, LONGEST length) const
enum lval_type lval() const
bool bits_synthetic_pointer(LONGEST offset, LONGEST length) const
gdb::array_view< const gdb_byte > contents_for_printing()
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)
#define PRINT_MAX_CHARS_DEFAULT
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)
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 *finished)
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 const literal_def print_characters_literals[]
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)
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)
static void show_print_max_chars(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
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)
#define PRINT_MAX_CHARS_ELEMENTS
@ Val_prettyformat_default
static unsigned int get_print_max_chars(const struct value_print_options *options)
#define PRINT_MAX_CHARS_UNLIMITED
struct value * coerce_ref_if_computed(const struct value *arg)
CORE_ADDR unpack_pointer(struct type *type, const gdb_byte *valaddr)
const char * value_internal_function_name(struct value *val)
void pack_long(gdb_byte *buf, struct type *type, LONGEST num)
LONGEST unpack_long(struct type *type, const gdb_byte *valaddr)