Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch, testsuite] check for UTF-32 target wide charset support in gdb.base/wchar.exp
@ 2015-09-17  3:25 Sandra Loosemore
  2015-09-17  4:31 ` Doug Evans
  2015-09-17  5:07 ` Eli Zaretskii
  0 siblings, 2 replies; 10+ messages in thread
From: Sandra Loosemore @ 2015-09-17  3:25 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

This patch is related to the one I posted yesterday to make 
with_target_charset do something reasonable in the absence of ICONV support:

https://sourceware.org/ml/gdb-patches/2015-09/msg00357.html

If GDB is configured without ICONV support, the target wide charset 
defaults to "ISO-8859-1" (which isn't even a wide charset), and all the 
wide strings in this test print as gibberish.  Otherwise, GDB seems to 
think the default is "auto; currently UTF-32", so let's make the 
dependency on UTF-32 explicit here and bail out if it's not available.

OK to commit?

-Sandra


[-- Attachment #2: wchar.log --]
[-- Type: text/x-log, Size: 167 bytes --]

2015-09-16  Sandra Loosemore  <sandra@codesourcery.com>

	gdb/testsuite/
	* gdb.base/wchar.exp: Require UTF-32 target wide charset support,
	otherwise skip this test.

[-- Attachment #3: wchar.patch --]
[-- Type: text/x-patch, Size: 726 bytes --]

diff --git a/gdb/testsuite/gdb.base/wchar.exp b/gdb/testsuite/gdb.base/wchar.exp
index 1a5a2d4..171385b 100644
--- a/gdb/testsuite/gdb.base/wchar.exp
+++ b/gdb/testsuite/gdb.base/wchar.exp
@@ -24,6 +24,19 @@ if ![runto "wchar.c:$bp_location" ] then {
   return -1
 }
 
+# This test requires wide character support in GDB.
+# Setting the charset may fail if GDB was configured without
+# ICONV support.
+gdb_test_multiple "set target-wide-charset UTF-32" "" {
+    -re "Undefined item.*$gdb_prompt " {
+	unsupported "Unknown charset UTF-32"
+	return -1
+    }
+    -re ".*$gdb_prompt " {
+	pass "set target-wide-charset UTF-32"
+    }
+}
+
 gdb_test "print narrow" "= 97 L'a'"
 
 gdb_test "print single" "= 48879 L'\\\\xbeef'"

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-09-29 13:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-17  3:25 [patch, testsuite] check for UTF-32 target wide charset support in gdb.base/wchar.exp Sandra Loosemore
2015-09-17  4:31 ` Doug Evans
2015-09-17  5:10   ` Eli Zaretskii
2015-09-18  4:38     ` Doug Evans
2015-09-17  5:07 ` Eli Zaretskii
2015-09-17  5:17   ` Sandra Loosemore
2015-09-17  5:59     ` Eli Zaretskii
2015-09-18  4:48     ` Doug Evans
2015-09-29 13:50       ` Pedro Alves
2015-09-18  4:41   ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox