From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10904 invoked by alias); 15 Apr 2013 16:23:24 -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 10894 invoked by uid 89); 15 Apr 2013 16:23:23 -0000 X-Spam-SWARE-Status: No, score=-8.1 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; Mon, 15 Apr 2013 16:23:23 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3FGNGde027628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Apr 2013 12:23:17 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3FGNEfD024511; Mon, 15 Apr 2013 12:23:15 -0400 Message-ID: <516C2972.1030802@redhat.com> Date: Mon, 15 Apr 2013 19:41: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> <5167F13F.6090007@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00432.txt.bz2 On 04/15/2013 03:57 PM, Hui Zhu wrote: > On Fri, Apr 12, 2013 at 7:34 PM, Pedro Alves wrote: >> 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. > > > Post a new version change the continue to mi_run_cmd, gdb_expect and > mi_send_resuming_command. > It works OK with loop test. $ (set -e; while true; do make check RUNTESTFLAGS="mi-dprintf.exp"; done) ... Running ../../../src/gdb/testsuite/gdb.mi/mi-dprintf.exp ... FAIL: gdb.mi/mi-dprintf.exp: gdb: mi 1st dprintf stop (timeout) FAIL: gdb.mi/mi-dprintf.exp: mi 1st dprintf, agent FAIL: gdb.mi/mi-dprintf.exp: mi 2nd dprintf, agent FAIL: gdb.mi/mi-dprintf.exp: mi info dprintf second time Did you try gdb/contrib/expect-read1.sh ? -- Pedro Alves