This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [commit/testsuite] Improve reliability of charset.exp


On Tuesday 16 February 2010 20:16:17, Daniel Jacobowitz wrote:

>         gdb/testsuite/
>         * gdb.base/charset.exp: Use a single regular expression to match
>         show host-charset and show target-charset output.

> +       set host_charset_list [regsub -all {, } $host_charset_list {,}]

This regsub syntax doesn't work on older tcl's:

Running ../../../src/gdb/testsuite/gdb.base/charset.exp ...
ERROR OCCURED: wrong # args: should be "regsub ?switches? exp string subSpec varName"
    while executing
"regsub -all {, } $host_charset_list {,}"
    invoked from within
"expect -nobrace -i exp6 -timeout 10 -re {Requires an argument. Valid arguments are (.*)\.
\(gdb\) $} {
(...)

I'm applying the fix below to use the old regsub syntax
instead; should work everywhere.

-- 
Pedro Alves

2010-02-17  Pedro Alves  <pedro@codesourcery.com>

	gdb/testsuite/
        * gdb.cp/charset.exp: Don't assume new `regsub' syntax available.

---
 gdb/testsuite/gdb.base/charset.exp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: src/gdb/testsuite/gdb.base/charset.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/charset.exp	2010-02-17 20:16:47.000000000 +0000
+++ src/gdb/testsuite/gdb.base/charset.exp	2010-02-17 20:20:40.000000000 +0000
@@ -140,7 +140,7 @@ send_gdb "set host-charset\n"
 gdb_expect {
     -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 {,}]
+	regsub -all {, } $host_charset_list {,} host_charset_list
 	foreach host_charset [split $host_charset_list ","] {
 	    set charsets($host_charset) 1
 	}
@@ -168,7 +168,7 @@ send_gdb "set target-charset\n"
 gdb_expect {
     -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 {,}]
+	regsub -all {, } $target_charset_list {,} target_charset_list
 	foreach target_charset [split $target_charset_list ","] {
 	    if {! [info exists charsets($target_charset)]} {
 		set charsets($target_charset) 0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]