aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/charset.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/charset.exp')
-rw-r--r--gdb/testsuite/gdb.base/charset.exp20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 7a96bb8..8ef217a 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -610,6 +610,26 @@ if {$ucs2_ok && $ucs4_ok} {
test_combination u UTF-16 U UTF-32
}
+if {$ucs2_ok} {
+ set go 1
+ gdb_test_multiple "python print 'hello, world!'" \
+ "verify python support for charset tests" {
+ -re "not supported.*$gdb_prompt $" {
+ unsupported "python support is disabled"
+ set go 0
+ }
+ -re "$gdb_prompt $" {}
+ }
+
+ if {$go} {
+ gdb_test "print u\"abcdef\"" " = u\"abcdef\"" \
+ "set up for python printing of utf-16 string"
+
+ gdb_test "python print gdb.history(0).string()" "abcdef" \
+ "extract utf-16 string using python"
+ }
+}
+
# Regression test for a cleanup bug in the charset code.
gdb_test "print 'a' == 'a' || 'b' == 'b'" \
".* = 1" \