From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31331 invoked by alias); 12 Apr 2013 11:34:35 -0000 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 Received: (qmail 31321 invoked by uid 89); 12 Apr 2013 11:34:35 -0000 X-Spam-SWARE-Status: No, score=-8.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 12 Apr 2013 11:34:35 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3CBYRWA012347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Apr 2013 07:34:27 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3CBYN8M010461; Fri, 12 Apr 2013 07:34:25 -0400 Message-ID: <5167F13F.6090007@redhat.com> Date: Fri, 12 Apr 2013 15:22:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Hui Zhu CC: Eli Zaretskii , Hui Zhu , gdb-patches ml , Marc Khouzam Subject: Re: [PATCH] add -s option to make -break-insert support dprintf References: <515451EA.1000200@mentor.com> <83y5d7wpvq.fsf@gnu.org> <516454DA.9040109@redhat.com> <51667EDC.9070207@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00380.txt.bz2 On 04/12/2013 11:38 AM, Hui Zhu wrote: >> > >> > I still get: >> > >> > $ make check gdbserver RUNTESTFLAGS="--target_board=native-gdbserver mi-dprintf.exp" > This part is really odd. > In my part, without "sleep 1" will random get fail with "Set dprintf > style to agent ". > The reason of fail is test try to check the output before it call > send_gdb "set dprintf-style agent\n". > This is why I add a "sleep 1" for it. > > But looks it still not OK in your part, so I change it to: > mi_gdb_test "pwd" ".*" > > If it is still not OK in your part, I suggest remove this part of test > because it is not very important for this test. The "set > dprintf-style agent" is tested in "dprintf.exp". > No, it's not okay. And it's not okay to just sweep it under the rug. I believe the problem is that the test is sending CLI resumption commands: + mi_gdb_test "continue" ".*At foo entry.*arg=1234, g=1234.*" "mi 1st dprintf" + mi_gdb_test "continue" ".*At foo entry.*arg=1235, g=2222.*" "mi 2nd dprintf" "continue" sent from MI causes two prompts to appear: (gdb) continue &"continue\n" ~"Continuing.\n" ^running *running,thread-id="all" (gdb) =breakpoint-modified,bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="0x000000000045a3ff",func="main",file="../../src/gdb/gdb.c",fullname="/home/pedro/gdb/mygit/src/gdb/gdb.c",line="32",thread-groups=["i1"],times="1",original-location="/home/pedro/gdb/mygit/src/gdb/gdb.c:32"} ~"\nBreakpoint " ~"6, main (argc=1, argv=0x7fffffffdc58) at ../../src/gdb/gdb.c:32\n" ~"32\t args.use_windows = 0;\n" *stopped,reason="breakpoint-hit",disp="keep",bkptno="6",frame={addr="0x000000000045a3ff",func="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffdc58"}],file="../../src/gdb/gdb.c",fullname="/home/pedro/gdb/mygit/src/gdb/gdb.c",line="32"},thread-id="1",stopped-threads="all",core="0" (gdb) and that is confusing the test (the regex for the prompt is probably stopping at the first prompt sometimes). The test should be adjusted to do MI -exec-continue instead, with mi_execute_to "exec-continue", mi_send_resuming_command "exec-continue" or something like that. BTW, you don't need to use gdbserver to trigger the issue. Native works too. E.g., leave this running, and eventually, it should FAIL and stop: $ (set -e; while true; do make check RUNTESTFLAGS="mi-dprintf.exp"; done) gdb/contrib/expect-read1.sh probably makes this reproducible all the time, though I haven't tried. -- Pedro Alves