summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-02-16 20:13:14 +0000
committerDaniel Jacobowitz <drow@false.org>2010-02-16 20:13:14 +0000
commitb519e2a636df83d31818d397896e69763439cde2 (patch)
treea09dfc057873b8baa450f0267b625e0c5e9cddd7
parentd66a7a7bd2b7292befc081c3dd59f73d5320657d (diff)
downloadbinutils-gdb-b519e2a636df83d31818d397896e69763439cde2.tar.gz
gdb/testsuite/
* gdb.base/charset.exp: Use a single regular expression to match show host-charset and show target-charset output.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/charset.exp47
2 files changed, 19 insertions, 33 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6196c587db3..eaff2110ee4 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-16 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb.base/charset.exp: Use a single regular expression to match
+ show host-charset and show target-charset output.
+
2010-02-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/attach.exp (attach to nonsense is prohibited): Make the
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index d1d010d0863..6b6f3b75c06 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -138,28 +138,19 @@ proc valid_target_charset {charset} {
send_gdb "set host-charset\n"
gdb_expect {
- -re "Requires an argument. Valid arguments are (\[^ \t\n\r,.\]*)" {
- #set host_charset_list $expect_out(1,string)
- set charsets($expect_out(1,string)) 1
- exp_continue
- #pass "capture valid host charsets"
- }
-
- -re ", (\[^ \t\n\r,.\]*)" {
- #set host_charset_list $expect_out(1,string)
- set charsets($expect_out(1,string)) 1
- exp_continue
- #pass "capture valid host charsets"
- }
-
- -re "\\.\r\n$gdb_prompt $" {
- #set host_charset_list $expect_out(1,string)
+ -re "Requires an argument. Valid arguments are (.*)\\.\r\n$gdb_prompt $" {
+ set host_charset_list $expect_out(1,string)
+ set host_charset_list [regsub -all {, } $host_charset_list {,}]
+ foreach host_charset [split $host_charset_list ","] {
+ set charsets($host_charset) 1
+ }
pass "capture valid host charsets"
}
-re ".*$gdb_prompt $" {
fail "capture valid host charsets"
}
+
timeout {
fail "(timeout) capture valid host charsets"
}
@@ -175,25 +166,15 @@ if {[llength [array names charsets]] < 3} {
send_gdb "set target-charset\n"
gdb_expect {
- -re "Requires an argument. Valid arguments are (\[^ \t\n\r,.\]*)" {
- set target_charset $expect_out(1,string)
- if {! [info exists charsets($target_charset)]} {
- set charsets($target_charset) 0
- }
- exp_continue
- }
-
- -re ", (\[^ \t\n\r,.\]*)" {
- set target_charset $expect_out(1,string)
- if {! [info exists charsets($target_charset)]} {
- set charsets($target_charset) 0
+ -re "Requires an argument. Valid arguments are (.*)\\.\r\n$gdb_prompt $" {
+ set target_charset_list $expect_out(1,string)
+ set target_charset_list [regsub -all {, } $target_charset_list {,}]
+ foreach target_charset [split $target_charset_list ","] {
+ if {! [info exists charsets($target_charset)]} {
+ set charsets($target_charset) 0
+ }
}
- exp_continue
- }
-
- -re "\\.\r\n$gdb_prompt $" {
pass "capture valid target charsets"
-
}
-re ".*$gdb_prompt $" {