diff options
author | Jim Blandy <jimb@codesourcery.com> | 2002-01-21 18:46:33 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2002-01-21 18:46:33 +0000 |
commit | 80495efa5369e75ec7ceb712522ddeff07df0746 (patch) | |
tree | 665106206fa067e9c71dc0e41f361de6fe6e21ad | |
parent | 05ac6407044fe8c1f0364dfa90696bcf5528e0ec (diff) | |
download | gdb-80495efa5369e75ec7ceb712522ddeff07df0746.tar.gz |
* 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.
-rw-r--r-- | gdb/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/ending-run.c | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/ending-run.exp | 4 |
3 files changed, 14 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f0e90a758de..e3c5dc8db99 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2002-01-21 Jim Blandy <jimb@redhat.com> + + * 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. + 2002-01-20 Daniel Jacobowitz <drow@mvista.com> * gdb.c++/inherit.exp: Update copyright years. diff --git a/gdb/testsuite/gdb.base/ending-run.c b/gdb/testsuite/gdb.base/ending-run.c index ccf8c502668..8c67706fbe9 100644 --- a/gdb/testsuite/gdb.base/ending-run.c +++ b/gdb/testsuite/gdb.base/ending-run.c @@ -22,12 +22,12 @@ int main() int i; p = (int *) malloc( 4 ); - setvbuf (stdout, alloca (64), _IOLBF, 64); + for (i = 1; i < 10; i++) { printf( "%d ", callee( i )); - + fflush (stdout); } - printf( " Goodbye!\n" ); + printf( " Goodbye!\n" ); fflush (stdout); return 0; } diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp index 88205b00849..4b2e427f0e1 100644 --- a/gdb/testsuite/gdb.base/ending-run.exp +++ b/gdb/testsuite/gdb.base/ending-run.exp @@ -129,10 +129,10 @@ gdb_expect { # See if we can step out with control. The "1 2 3" stuff # is output from the program. # -gdb_test "cont" ".*Breakpoint.*31.*" +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" ".*1 2 7 14 23 34 47 62 79 Goodbye!.*32.*" \ + gdb_test "next" ".*Goodbye!.*32.*" \ "Step to return" } else { gdb_test "next" "" "" |