From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5403 invoked by alias); 11 May 2006 14:39:18 -0000 Received: (qmail 5393 invoked by uid 22791); 11 May 2006 14:39:17 -0000 X-Spam-Check-By: sourceware.org Received: from w099.z064220152.sjc-ca.dsl.cnc.net (HELO duck.specifix.com) (64.220.152.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 May 2006 14:39:12 +0000 Received: from [::1] (duck.specifix.com [64.220.152.99]) by duck.specifix.com (Postfix) with ESMTP id 7A68241FB for ; Thu, 11 May 2006 07:39:10 -0700 (PDT) From: Fred Fish Reply-To: fnf@specifix.com To: gdb-patches@sourceware.org Subject: Re: [RFA] Handle output after 'Program exited normally' consistently (detect spurious output) Date: Thu, 11 May 2006 14:39:00 -0000 User-Agent: KMail/1.9.1 References: <200605110709.11444.fnf@specifix.com> In-Reply-To: <200605110709.11444.fnf@specifix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605111039.54405.fnf@specifix.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00218.txt.bz2 On Thursday 11 May 2006 07:09, Fred Fish wrote: > If we care about testing for cruft between the exit message and the > gdb prompt, to specifically catch that case, then I think that should > have it's own dedicated testcase, which I'm happy to write and submit. I modified the a2-run.exp test to allow it to run the part of the test that doesn't require being able to pass arguments, and detect spurious output after the program exits normally. Patch below. -Fred 2006-05-11 Fred Fish * gdb.base/a2-run.exp: Allow part of test to run when args aren't required. Check for spurious output after program exits normally. Index: gdb.base/a2-run.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/a2-run.exp,v retrieving revision 1.5 diff -c -p -r1.5 a2-run.exp *** gdb.base/a2-run.exp 7 May 2002 00:45:44 -0000 1.5 --- gdb.base/a2-run.exp 11 May 2006 14:37:50 -0000 *************** *** 20,32 **** # This file was written by Rob Savoye. (rob@cygnus.com) - # These tests don't work for targets can't take arguments... - - if [target_info exists noargs] then { - verbose "Skipping a2-run.exp because of noargs." - return - } - # Can't do this test without stdio support. if [gdb_skip_stdio_test "a2run.exp"] { return --- 20,25 ---- *************** if [istarget "*-*-vxworks*"] then { *** 77,87 **** --- 70,90 ---- gdb_expect -re "$gdb_prompt $" {} } else { gdb_expect { + -re ".*usage: factorial .*Program exited with code 01\.\r\n$gdb_prompt $" { + pass "run \"$testfile\" with no args" + pass "no spurious messages at program exit" + } -re ".*usage: factorial .*Program exited with code 01.*$gdb_prompt $" { pass "run \"$testfile\" with no args" + fail "no spurious messages at program exit" + } + -re ".*usage: factorial .* EXIT code 1.*Program exited normally\.\r\n$gdb_prompt $" { + pass "run \"$testfile\" with no args (exit wrapper)" + pass "no spurious messages at program exit" } -re ".*usage: factorial .* EXIT code 1.*Program exited normally.*$gdb_prompt $" { pass "run \"$testfile\" with no args (exit wrapper)" + fail "no spurious messages at program exit" } -re ".*$gdb_prompt $" { fail "run \"$testfile\" with no args" *************** if [istarget "*-*-vxworks*"] then { *** 92,97 **** --- 95,108 ---- } } } + + # The remaining tests don't work for targets can't take arguments... + + if [target_info exists noargs] then { + verbose "Skipping rest of a2-run.exp because of noargs." + return + } + # Now run with some arguments if [istarget "*-*-vxworks*"] then { send_gdb "run vxmain \"5\"\n"