From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126002 invoked by alias); 27 Mar 2015 16:46:52 -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 125979 invoked by uid 89); 27 Mar 2015 16:46:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 27 Mar 2015 16:46:51 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2RGkkau020971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 27 Mar 2015 12:46:46 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2RGkj6N028513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Mar 2015 12:46:46 -0400 Message-ID: <55158974.2040506@redhat.com> Date: Fri, 27 Mar 2015 16:46:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Antoine Tremblay , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix MI dprintf-insert not printing when a location is pending. References: <1427388426-26548-1-git-send-email-antoine.tremblay@ericsson.com> <551459BF.9090406@redhat.com> <55154E63.5040603@ericsson.com> In-Reply-To: <55154E63.5040603@ericsson.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00912.txt.bz2 On 03/27/2015 05:34 AM, Antoine Tremblay wrote: > On 03/26/2015 03:10 PM, Keith Seitz wrote: >> On 03/26/2015 09:47 AM, Antoine Tremblay wrote: >>> +# Set pending dprintf via MI. >>> +mi_gdb_test "-dprintf-insert -f pendfunc1 \"hello\"" \ >>> + >>> ".*\\^done,bkpt={number=\"1\",type=\"dprintf\",disp=\"keep\",enabled=\"y\",addr=\"\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"}" >>> >>> \ >>> + "mi set dprintf" >>> + >>> +mi_gdb_test "-break-insert $bp_location1" ".*" "mi insert breakpoint >>> bp_location1" >> >> Is it possible to use mi_make_breakpoint for these tests? > > Unfortunately for the dprintf one mi_make_breakpoint doesn't support > pending breakpoints, it creates something like : > bkpt={number="2",type=".*",disp=".*",enabled=".*",addr=".*",func=".*", > file=".*/myfile.c",fullname=".*",line="3",thread-groups=\[.*\], > times="0".*original-location=".*"} > > But with pending funcs it should be pending= ... Ah, I see. Thank you for pointing that out. I *thought* that I did that already! > It could be the subject of another patch to add that support. > Indeed. > I used mi_create_breakpoint for the other breakpoint now > Excellent. >>> +mi_run_cmd >>> + >>> +set msg "mi dprintf" >>> +gdb_expect { >>> + -re ".*~\"hello\"" { >>> + pass $msg >>> + } >>> + -re ".*$mi_gdb_prompt$" { >>> + fail $msg >>> + } >>> + timeout { >>> + fail $msg >>> + } >>> +} >> >> This a pretty common test suite idiom, I think. Can mi_gdb_test be used >> instead of gdb_expect? > > That I can't since mi_gdb_test requires a command and in this case I'm > just doing expect on that comes after mi_run_cmd, there's no command > associated with it.. While not common in gdb.mi (with mi_gdb_test), the rest of gdb.* uses the idiom: gdb_test "" ... all the time. Looking at the description of mi_gdb_test: # mi_gdb_test COMMAND PATTERN MESSAGE [IPATTERN] -- send a command to gdb; # test the result. # # COMMAND is the command to execute, send to GDB with send_gdb. If # this is the null string no command is sent. [Very quickly] Browsing through the code of that function, it seems like it should work. If it does not, would you please file a bug? It *definitely* should work. Keith