From patchwork Mon Feb 23 13:54:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 5237 Received: (qmail 4121 invoked by alias); 23 Feb 2015 13:54:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4033 invoked by uid 89); 23 Feb 2015 13:54:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 23 Feb 2015 13:54:26 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1NDsOZX014342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 23 Feb 2015 08:54:24 -0500 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1NDsKZh000641 for ; Mon, 23 Feb 2015 08:54:24 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 3/6] gdb_test_multiple: Fix user code argument processing Date: Mon, 23 Feb 2015 13:54:17 +0000 Message-Id: <1424699660-11727-4-git-send-email-palves@redhat.com> In-Reply-To: <1424699660-11727-1-git-send-email-palves@redhat.com> References: <1424699660-11727-1-git-send-email-palves@redhat.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 * 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 } {