aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-09-25 21:39:53 +0000
committerTom Tromey <tromey@redhat.com>2009-09-25 21:39:53 +0000
commit96c07c5b96e970c93ab71a1f351ca669bba78d1a (patch)
tree0228be5148273ed3078a199936b4ebf6cb9534d5 /gdb/testsuite
parentb8899f2b6861deda28ccc10d925105e7e516d68b (diff)
downloadgdb-96c07c5b96e970c93ab71a1f351ca669bba78d1a.zip
gdb-96c07c5b96e970c93ab71a1f351ca669bba78d1a.tar.gz
gdb-96c07c5b96e970c93ab71a1f351ca669bba78d1a.tar.bz2
gdb
PR python/10664: * language.h (struct language_defn) <la_get_string>: Add 'char_type' argument. (LA_GET_STRING): Likewise. (default_get_string, c_get_string): Update. * language.c (default_get_string): Add 'char_type' argument. * c-valprint.c (c_textual_element_type): Rename from textual_element_type. No longer static. Update callers. * c-lang.h (c_textual_element_type): Declare. * c-lang.c (c_get_string): Add 'char_type' argument. gdb/testsuite PR python/10664: * gdb.base/charset.exp: Test utf-16 strings with Python.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/charset.exp20
2 files changed, 24 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 3695a9b..54f7963 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2009-09-25 Tom Tromey <tromey@redhat.com>
+ * gdb.base/charset.exp: Test utf-16 strings with Python.
+
+2009-09-25 Tom Tromey <tromey@redhat.com>
+
* gdb.base/charset.exp: Use UTF-16 and UTF-32, not UCS-2 and
UCS-4.
* gdb.base/charset.c (utf_32_string): Rename.
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" \