From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30712 invoked by alias); 13 Jun 2008 19:55:49 -0000 Received: (qmail 30538 invoked by uid 22791); 13 Jun 2008 19:55:48 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 13 Jun 2008 19:55:30 +0000 Received: (qmail 14438 invoked from network); 13 Jun 2008 19:55:28 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 Jun 2008 19:55:28 -0000 From: Vladimir Prus Date: Fri, 13 Jun 2008 20:10:00 -0000 Subject: [commit] Robustify mi-simplerun. To: gdb-patches@sources.redhat.com X-TUID: 0f6ce5cd21df0ec2 X-Length: 3392 X-UID: 234 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200806132355.42833.vladimir@codesourcery.com> 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: 2008-06/txt/msg00245.txt.bz2 The program been run by this testcase produces output. Since GDB prints the *running notification, and the prompt, after actually resuming the program, there's a race condition -- the program may produce the output before gdb prints the prompt, which breaks the test. This patch add artificial delay to the program to make sure gdb print the prompt first. Checked in. - Volodya [testsuite] * gdb.mi/basics.c (main): Add a call to sleep. * gdb.mi/mi-cli.exp: Adjust for change in line numbers. * gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi-break.exp: Likewise. --- gdb/testsuite/gdb.mi/basics.c | 9 ++------- gdb/testsuite/gdb.mi/mi-break.exp | 2 +- gdb/testsuite/gdb.mi/mi-cli.exp | 2 +- gdb/testsuite/gdb.mi/mi2-cli.exp | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.mi/basics.c b/gdb/testsuite/gdb.mi/basics.c index e4be7b2..43e1816 100644 --- a/gdb/testsuite/gdb.mi/basics.c +++ b/gdb/testsuite/gdb.mi/basics.c @@ -21,6 +21,7 @@ */ #include +#include int callee4 (void) { @@ -61,6 +62,7 @@ main () callee1 (2, "A string argument.", 3.5); callee1 (2, "A string argument.", 3.5); + sleep (1); printf ("Hello, World!"); callme (1); @@ -68,10 +70,3 @@ main () return 0; } - -/* -Local variables: -change-log-default-name: "ChangeLog-mi" -End: -*/ - diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index b3fc551..2776fda 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -158,7 +158,7 @@ proc test_ignore_count {} { mi_run_cmd - mi_expect_stop "breakpoint-hit" "callme" "\{name=\"i\",value=\"2\"\}" ".*basics.c" "51" \ + mi_expect_stop "breakpoint-hit" "callme" "\{name=\"i\",value=\"2\"\}" ".*basics.c" "52" \ {"" "disp=\"keep\"" } "run to breakpoint with ignore count" } diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp index c488449..37c484b 100644 --- a/gdb/testsuite/gdb.mi/mi-cli.exp +++ b/gdb/testsuite/gdb.mi/mi-cli.exp @@ -96,7 +96,7 @@ mi_gdb_test "-interpreter-exec console \"list\"" \ ".*\~\"$line_main_body\[\\\\t \]*callee1.*;\\\\n\".*\\^done" \ "-interpreter-exec console \"list\"" -mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "27" \ +mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "28" \ { "" "disp=\"keep\"" } "continue to callee4" # NOTE: cagney/2003-02-03: Not yet. diff --git a/gdb/testsuite/gdb.mi/mi2-cli.exp b/gdb/testsuite/gdb.mi/mi2-cli.exp index d9e3467..0f5a771 100644 --- a/gdb/testsuite/gdb.mi/mi2-cli.exp +++ b/gdb/testsuite/gdb.mi/mi2-cli.exp @@ -96,7 +96,7 @@ mi_gdb_test "-interpreter-exec console \"list\"" \ ".*\~\"$line_main_body\[\\\\t \]*callee1.*;\\\\n\".*\\^done" \ "-interpreter-exec console \"list\"" -mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "27" \ +mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "28" \ { "" "disp=\"keep\"" } \ "continue to callee4" -- 1.5.3.5