From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26302 invoked by alias); 10 Jun 2014 18:52:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26289 invoked by uid 89); 10 Jun 2014 18:52:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS 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 ESMTP; Tue, 10 Jun 2014 18:52:38 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5AIqZda019107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jun 2014 14:52:36 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5AIqYS6028726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 10 Jun 2014 14:52:35 -0400 Message-ID: <539753F2.8080406@redhat.com> Date: Tue, 10 Jun 2014 18:52:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "Maciej W. Rozycki" , gdb-patches@sourceware.org Subject: Re: [PATCH] GDB/testsuite: Add a way to send multiple init commands References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00427.txt.bz2 On 06/10/2014 11:22 AM, Maciej W. Rozycki wrote: > Index: gdb-fsf-trunk-quilt/gdb/testsuite/lib/gdb.exp > =================================================================== > --- gdb-fsf-trunk-quilt.orig/gdb/testsuite/lib/gdb.exp 2014-06-06 15:04:15.000000000 +0100 > +++ gdb-fsf-trunk-quilt/gdb/testsuite/lib/gdb.exp 2014-06-06 15:05:05.867648960 +0100 > @@ -219,6 +219,19 @@ proc gdb_run_cmd {args} { > } > } > } > + if [target_info exists gdb_init_commands] { > + set commands [target_info gdb_init_commands]; > + for { set x 0; } { $x < [llength $commands] } { incr x } { > + send_gdb "[lindex $commands $x]\n"; The "normal" Tcl idiom for this is foreach: foreach cmd $commands { send_gdb $cmd # ... > + gdb_expect 30 { > + -re "$gdb_prompt $" { } > + default { > + perror "gdb_init_command for target failed"; > + return; > + } > + } > + } > + } Keith