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"
}
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 $" {