From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12465 invoked by alias); 13 Sep 2002 18:06:54 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12458 invoked from network); 13 Sep 2002 18:06:53 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 13 Sep 2002 18:06:53 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g8DHoBw17889 for ; Fri, 13 Sep 2002 13:50:11 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g8DI6pd22370 for ; Fri, 13 Sep 2002 14:06:51 -0400 Received: from cygbert.vinschen.de (vpn50-17.rdu.redhat.com [172.16.50.17]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g8DI6nC10670 for ; Fri, 13 Sep 2002 11:06:49 -0700 Received: (from corinna@localhost) by cygbert.vinschen.de (8.11.6/8.9.3/Linux sendmail 8.9.3) id g8DI6hk03600 for gdb@sources.redhat.com; Fri, 13 Sep 2002 20:06:43 +0200 Date: Fri, 13 Sep 2002 11:06:00 -0000 From: Corinna Vinschen To: gdb@sources.redhat.com Subject: Expect fails to recognize regexp Message-ID: <20020913200643.I1574@cygbert.vinschen.de> Reply-To: gdb@sources.redhat.com Mail-Followup-To: gdb@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.22.1i X-SW-Source: 2002-09/txt/msg00156.txt.bz2 Hi, I'm trying to fix an error in the testsuite lib but I'm stuck at one point. For some mysterious reason, I can't get a regexp right. Ok, the original preoblem I'm trying to solve is, that in lib/gdb.exp, proc rerun_to_main() the procedure doesn't take into account, that some targets never actually exit, but instead are programatically trapped in some _exit function. This means that rerun_to_main() must be able to manage the situation that gdb not just reruns, but first asks The program being debugged has been started already. Start it from the beginning? (y or n) What I did was adding the following patch to gdb.exp: Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.26 diff -u -p -r1.26 gdb.exp --- lib/gdb.exp 13 Sep 2002 17:20:11 -0000 1.26 +++ lib/gdb.exp 13 Sep 2002 17:59:35 -0000 @@ -1685,6 +1685,10 @@ proc rerun_to_main {} { } else { send_gdb "run\n" gdb_expect { + -re "The program .* has been started already.*y or n. $" { + send_gdb "y\n" + exp_continue + } -re "Starting program.*$gdb_prompt $"\ {pass "rerun to main" ; return 0} -re "$gdb_prompt $"\ but it doesn't work! I tried various... uhm... variations of the expression, include simple stuff as -re "The program.*" or moving the -re back and forth in the gdb_expect expression but to no avail. The result in gdb.log was always the same: (gdb) PASS: gdb.base/ena-dis-br.exp: continue until exit at no stop run^M The program being debugged has been started already.^M Start it from the beginning? (y or n) FAIL: gdb.base/ena-dis-br.exp: (timeout) rerun to main As you can see, there's no 'y' in the log so expect didn't recognize the expression at all. Does anybody have an idea what's going on here? Corinna -- Corinna Vinschen Cygwin Developer Red Hat, Inc. mailto:vinschen@redhat.com