From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31532 invoked by alias); 21 Oct 2011 08:33:03 -0000 Received: (qmail 31503 invoked by uid 22791); 21 Oct 2011 08:33:02 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Oct 2011 08:32:47 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9L8Wl1d020281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Oct 2011 04:32:47 -0400 Received: from host1.jankratochvil.net (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9L8WibT001664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Oct 2011 04:32:46 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p9L8WhZW024404; Fri, 21 Oct 2011 10:32:43 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p9L8WgRC024403; Fri, 21 Oct 2011 10:32:42 +0200 Date: Fri, 21 Oct 2011 08:42:00 -0000 From: Jan Kratochvil To: Kevin Pouget Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: Dejagnu testing issue Message-ID: <20111021083242.GA8363@host1.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2011-10/txt/msg00588.txt.bz2 On Fri, 21 Oct 2011 10:14:42 +0200, Kevin Pouget wrote: > for the record, here is the way to get the pid based on "expect_out": > > gdb_test_multiple "info inferior" "list inferiors" { > -re ".* \* 1.*process (\[0-9\]*).*$gdb_prompt $" { > set pid $expect_out(1,string) > pass "list inferiors" > } > } While it works to make it working as was intended it could be for example: gdb_test_multiple "info inferior" "list inferiors" { -re "\r\n\\* 1 *process (\[0-9\]*) .*\r\n$gdb_prompt $" { set pid $expect_out(1,string) pass "list inferiors" } } Initial .* is redundant, start of the expect string is not anchored. \* is equal to * as the first level of backslashes is parsed by TCL interpreter, not by the regex compiler. If one fixes \* -> \\* to really match an asterisk it no longer matches. The asterisk is preceded by a newline, not by a space as in your regex string. Regards, Jan