From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5675 invoked by alias); 21 Jan 2002 16:31:25 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5616 invoked from network); 21 Jan 2002 16:31:22 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 21 Jan 2002 16:31:22 -0000 Received: from redhat.com (rtl.sfbay.redhat.com [205.180.230.21]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id IAA07578; Mon, 21 Jan 2002 08:31:18 -0800 (PST) Message-ID: <3C4C423C.E48F1010@redhat.com> Date: Mon, 21 Jan 2002 08:31:00 -0000 From: Fernando Nasser Organization: Red Hat Canada X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.9-13 i686) X-Accept-Language: en MIME-Version: 1.0 To: Jim Blandy CC: gdb-patches@sources.redhat.com Subject: Re: RFA: force output at predictable points in ending-run.c References: <20020112065251.549665E9D8@zwingli.cygnus.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00647.txt.bz2 Let's see if your fix makes this test results more predictable. Pleas check it in and thanks for looking into this. Regards, Fernando Jim Blandy wrote: > > 2002-01-12 Jim Blandy > > * gdb.base/ending-run.c (main): Avoid messing with setvbuf; just > call `fflush' after every `printf', so that the output is produced > at predictable points, regardless of whatever buffering does (or > doesn't) take place. > * gdb.base/ending-run.exp: Adjust tests to expect output to appear > at different points. > > Index: gdb/testsuite/gdb.base/ending-run.c > =================================================================== > RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/ending-run.c,v > retrieving revision 1.4 > diff -c -r1.4 ending-run.c > *** gdb/testsuite/gdb.base/ending-run.c 2001/09/18 17:50:36 1.4 > --- gdb/testsuite/gdb.base/ending-run.c 2002/01/12 06:47:54 > *************** > *** 22,33 **** > int i; > > p = (int *) malloc( 4 ); > ! setvbuf (stdout, alloca (64), _IOLBF, 64); > for (i = 1; i < 10; i++) > { > printf( "%d ", callee( i )); > ! > } > ! printf( " Goodbye!\n" ); > return 0; > } > --- 22,33 ---- > int i; > > p = (int *) malloc( 4 ); > ! > for (i = 1; i < 10; i++) > { > printf( "%d ", callee( i )); > ! fflush (stdout); > } > ! printf( " Goodbye!\n" ); fflush (stdout); > return 0; > } > Index: gdb/testsuite/gdb.base/ending-run.exp > =================================================================== > RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/ending-run.exp,v > retrieving revision 1.23 > diff -c -r1.23 ending-run.exp > *** gdb/testsuite/gdb.base/ending-run.exp 2001/11/10 22:27:26 1.23 > --- gdb/testsuite/gdb.base/ending-run.exp 2002/01/12 06:47:54 > *************** > *** 129,138 **** > # See if we can step out with control. The "1 2 3" stuff > # is output from the program. > # > ! gdb_test "cont" ".*Breakpoint.*31.*" > > if ![gdb_skip_stdio_test "Step to return"] { > ! gdb_test "next" ".*1 2 7 14 23 34 47 62 79 Goodbye!.*32.*" \ > "Step to return" > } else { > gdb_test "next" "" "" > --- 129,138 ---- > # See if we can step out with control. The "1 2 3" stuff > # is output from the program. > # > ! gdb_test "cont" ".*1 2 7 14 23 34 47 62 79.*Breakpoint.*31.*" > > if ![gdb_skip_stdio_test "Step to return"] { > ! gdb_test "next" ".*Goodbye!.*32.*" \ > "Step to return" > } else { > gdb_test "next" "" "" -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9