From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6059 invoked by alias); 16 Apr 2013 01:56:48 -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 6048 invoked by uid 89); 16 Apr 2013 01:56:48 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-oa0-f42.google.com (HELO mail-oa0-f42.google.com) (209.85.219.42) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 16 Apr 2013 01:56:47 +0000 Received: by mail-oa0-f42.google.com with SMTP id i18so544oag.29 for ; Mon, 15 Apr 2013 18:56:46 -0700 (PDT) X-Received: by 10.182.72.5 with SMTP id z5mr109114obu.24.1366077405927; Mon, 15 Apr 2013 18:56:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.13.133 with HTTP; Mon, 15 Apr 2013 18:56:05 -0700 (PDT) In-Reply-To: <516C2972.1030802@redhat.com> References: <515451EA.1000200@mentor.com> <83y5d7wpvq.fsf@gnu.org> <516454DA.9040109@redhat.com> <51667EDC.9070207@redhat.com> <5167F13F.6090007@redhat.com> <516C2972.1030802@redhat.com> From: Hui Zhu Date: Tue, 16 Apr 2013 09:31:00 -0000 Message-ID: Subject: Re: [PATCH] add -s option to make -break-insert support dprintf To: Pedro Alves Cc: Eli Zaretskii , Hui Zhu , gdb-patches ml , Marc Khouzam Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-04/txt/msg00454.txt.bz2 On Tue, Apr 16, 2013 at 12:23 AM, Pedro Alves wrote: > 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=3D"--target_board=3Dnative-gdbse= rver 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 comman= ds: >>> >>> + mi_gdb_test "continue" ".*At foo entry.*arg=3D1234, g=3D1234.*"= "mi 1st dprintf" >>> + mi_gdb_test "continue" ".*At foo entry.*arg=3D1235, g=3D2222.*"= "mi 2nd dprintf" >>> >>> "continue" sent from MI causes two prompts to appear: >>> >>> (gdb) >>> continue >>> &"continue\n" >>> ~"Continuing.\n" >>> ^running >>> *running,thread-id=3D"all" >>> (gdb) >>> =3Dbreakpoint-modified,bkpt=3D{number=3D"6",type=3D"breakpoint",disp=3D= "keep",enabled=3D"y",addr=3D"0x000000000045a3ff",func=3D"main",file=3D"../.= ./src/gdb/gdb.c",fullname=3D"/home/pedro/gdb/mygit/src/gdb/gdb.c",line=3D"3= 2",thread-groups=3D["i1"],times=3D"1",original-location=3D"/home/pedro/gdb/= mygit/src/gdb/gdb.c:32"} >>> ~"\nBreakpoint " >>> ~"6, main (argc=3D1, argv=3D0x7fffffffdc58) at ../../src/gdb/gdb.c:32\n" >>> ~"32\t args.use_windows =3D 0;\n" >>> *stopped,reason=3D"breakpoint-hit",disp=3D"keep",bkptno=3D"6",frame=3D{= addr=3D"0x000000000045a3ff",func=3D"main",args=3D[{name=3D"argc",value=3D"1= "},{name=3D"argv",value=3D"0x7fffffffdc58"}],file=3D"../../src/gdb/gdb.c",f= ullname=3D"/home/pedro/gdb/mygit/src/gdb/gdb.c",line=3D"32"},thread-id=3D"1= ",stopped-threads=3D"all",core=3D"0" >>> (gdb) >>> >>> and that is confusing the test (the regex for the prompt is probably st= opping >>> 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=3D"mi-dprintf.exp"; d= one) >>> >>> 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=3D"mi-dprintf.exp"; don= e) > ... > 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 ? What I did is: EXPECT=3D../contrib/expect-read1.sh make check RUNTESTFLAGS=3D"mi-dprintf.e= xp" EXPECT=3D../contrib/expect-read1.sh make check RUNTESTFLAGS=3D"--target_board=3Dnative-gdbserver mi-dprintf.exp" And it is OK in my part. I did something wrong? Thanks, Hui > > -- > Pedro Alves >