This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/6] gdb_test_multiple: Fix user code argument processing
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 23 Feb 2015 13:54:17 +0000
- Subject: [PATCH 3/6] gdb_test_multiple: Fix user code argument processing
- Authentication-results: sourceware.org; auth=none
- References: <1424699660-11727-1-git-send-email-palves at redhat dot com>
While teaching gdb_test_multiple to forward "-i" to gdb_expect, I
found that with:
gdb_test_multiple (...) {
-i $some_variable -re "..." {}
}
$some_variable was not getting expanded in the gdb_test_multiple
caller's scope. This is a bug inside gdb_test_multiple. When
processing an argument in passed in user code, it was appending the
original argument literally, instead of appending the uplist'ed
argument.
gdb/testsuite/ChangeLog:
2015-02-23 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (gdb_test_multiple): When processing an argument,
append the substituted item, not the original item.
---
gdb/testsuite/lib/gdb.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index bbc657c..8e12ea4 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -720,7 +720,7 @@ proc gdb_test_multiple { command message user_code } {
}
if { $expecting_arg } {
set expecting_arg 0
- lappend processed_code $item
+ lappend processed_code $subst_item
continue
}
if { $expecting_action } {
--
1.9.3