void c_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *user_encoding, int force_ellipses, const struct value_print_options *options) { enum c_string_type str_type; const char *type_encoding; const char *encoding; str_type = (classify_type (type, get_type_arch (type), &type_encoding) & ~C_CHAR); switch (str_type) { case C_STRING: break; case C_WIDE_STRING: fputs_filtered ("L", stream); break; case C_STRING_16: fputs_filtered ("u", stream); break; case C_STRING_32: fputs_filtered ("U", stream); break; } encoding = (user_encoding && *user_encoding) ? user_encoding : type_encoding; generic_printstr (stream, type, string, length, encoding, force_ellipses, '"', 1, options); }
static void java_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) { const char *type_encoding = java_get_encoding (type); if (!encoding || !*encoding) encoding = type_encoding; generic_printstr (stream, type, string, length, encoding, force_ellipses, '"', 0, options); }
static void f_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) { const char *type_encoding = f_get_encoding (type); if (TYPE_LENGTH (type) == 4) fputs_filtered ("4_", stream); if (!encoding || !*encoding) encoding = type_encoding; generic_printstr (stream, type, string, length, encoding, force_ellipses, '\'', 0, options); }
void c_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *user_encoding, int force_ellipses, const struct value_print_options *options) { enum c_string_type str_type; const char *type_encoding; const char *encoding; enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); unsigned int i; unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; struct obstack wchar_buf, output; struct cleanup *cleanup; struct wchar_iterator *iter; int finished = 0; int need_escape = 0; str_type = (classify_type (type, get_type_arch (type), &type_encoding) & ~C_CHAR); switch (str_type) { case C_STRING: break; case C_WIDE_STRING: fputs_filtered ("L", stream); break; case C_STRING_16: fputs_filtered ("u", stream); break; case C_STRING_32: fputs_filtered ("U", stream); break; } encoding = (user_encoding && *user_encoding) ? user_encoding : type_encoding; generic_printstr (stream, type, string, length, encoding, force_ellipses, '"', 1, options); }