summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/wchar.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2012-11-10 20:19:01 +0000
committerKeith Seitz <keiths@redhat.com>2012-11-10 20:19:01 +0000
commit0d63ecdad04d410698c905283d095505680ba907 (patch)
tree3f894b47be2cfef2d36d71ffb1cb4d33717bd9b7 /gdb/testsuite/gdb.base/wchar.c
parent9b8d6827200e1b04d3ca860ce52472655e84248c (diff)
PR gdb/14288
* c-valprint.c (c_val_print): For character arrays with "print null" option on, print ellipses if the output is truncated and the next character is not \000. * valprint.c (MAX_WCHARS): Define. (WCHAR_BUFLEN): Likewise. (WCHAR_BUFLEN_MAX): Likewise. (struct converted_character): New structure. (count_next_character): New function. (print_converted_chars_to_obstack): New function. (generic_printstr): Rewrite using count_next_character and print_converted_chars_to_obstack. * gdb.base/printcmds.c: Add invalid_XXX globals for repeated byte tests. * gdb.base/printcmds.exp (test_repeat_bytes): New procedure. * gdb.base/wchar.c (main): Add and construct a wchar_t array with repeated characters. * gdb.base/wchar.exp: Add repeated character tests.
Diffstat (limited to 'gdb/testsuite/gdb.base/wchar.c')
-rw-r--r--gdb/testsuite/gdb.base/wchar.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/wchar.c b/gdb/testsuite/gdb.base/wchar.c
index 22f5beb534..7bdfd68677 100644
--- a/gdb/testsuite/gdb.base/wchar.c
+++ b/gdb/testsuite/gdb.base/wchar.c
@@ -25,11 +25,21 @@ do_nothing (wchar_t *c)
int
main (void)
{
+ int i;
wchar_t narrow = 97;
wchar_t single = 0xbeef;
wchar_t simple[] = L"facile";
wchar_t difficile[] = { 0xdead, 0xbeef, 0xfeed, 0xface};
wchar_t mixed[] = {L'f', 0xdead, L'a', L'c', 0xfeed, 0xface};
+ wchar_t *cent = L"\242";
+ wchar_t repeat[128];
+ wchar_t *repeat_p = repeat;
+
+ repeat[0] = 0;
+ wcscat (repeat, L"A");
+ for (i = 0; i < 21; ++i)
+ wcscat (repeat, cent);
+ wcscat (repeat, L"B");
do_nothing (&narrow); /* START */
do_nothing (&single);