From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8053 invoked by alias); 6 Aug 2010 15:08:03 -0000 Received: (qmail 7890 invoked by uid 22791); 6 Aug 2010 15:08:01 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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, 06 Aug 2010 15:07:55 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o76F7rML009590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 6 Aug 2010 11:07:54 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o76F7oeY027212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 6 Aug 2010 11:07:53 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o76F7oEV025893; Fri, 6 Aug 2010 17:07:50 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o76F7oOX025892; Fri, 6 Aug 2010 17:07:50 +0200 Date: Fri, 06 Aug 2010 15:08:00 -0000 From: Jan Kratochvil To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [RFA] testsuite: Avoid buffer overrun in gdb.base/default.exp Message-ID: <20100806150750.GA25094@host1.dyn.jankratochvil.net> References: <001801cb3578$15f7a550$41e6eff0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001801cb3578$15f7a550$41e6eff0$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-08/txt/msg00068.txt.bz2 On Fri, 06 Aug 2010 17:00:18 +0200, Pierre Muller wrote: When using attachments please use: Content-Disposition: inline and not Content-Disposition: attachment +gdb_test_multiple "info set" "info set" { + -re "confirm: Whether to confirm potentially dangerous operations is o\[a-z\]*.(\[^\r\n\]*\[\r\n\])+history filename: The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+listsize: Number of source lines gdb will list by default is 10.*" { + verbose "Confirm dislayed" + set set_confirm_seen 1 + exp_continue + } + -re "Gdb's prompt is \"$gdb_prompt \"" { + verbose "GDB prompt displayed" + set set_prompt_seen 1 + exp_continue + } + -re "Writing into executable.*$gdb_prompt $" { + verbose "write displayed" + if { $set_prompt_seen && $set_confirm_seen } { + pass "info set" + } else { + verbose "prompt $set_prompt_seen confirm $set_confirm_seen" + fail "info set (incomplete output)" + } + } +} The first pattern can eat up the text expected to be matched by the third pattern. This way the loop will never finish. Or do I miss something? The first pattern can match at once something like: confirm: Whether to confirm potentially dangerous operations is o history filename: The filename in which to record the command history is listsize: Number of source lines gdb will list by default is 10 Writing into executable (gdb) Thanks, Jan