From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19310 invoked by alias); 25 Mar 2013 04:08: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 19280 invoked by uid 89); 25 Mar 2013 04:08:37 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from mail-oa0-f46.google.com (HELO mail-oa0-f46.google.com) (209.85.219.46) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 25 Mar 2013 04:08:34 +0000 Received: by mail-oa0-f46.google.com with SMTP id k1so5963100oag.19 for ; Sun, 24 Mar 2013 21:08:33 -0700 (PDT) X-Received: by 10.60.155.200 with SMTP id vy8mr5233201oeb.68.1364184513454; Sun, 24 Mar 2013 21:08:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.13.133 with HTTP; Sun, 24 Mar 2013 21:07:53 -0700 (PDT) In-Reply-To: <514C3C85.4000704@codesourcery.com> References: <514BF736.3070706@mentor.com> <514C3C85.4000704@codesourcery.com> From: Hui Zhu Date: Mon, 25 Mar 2013 08:25:00 -0000 Message-ID: Subject: Re: [PATCH] Fix dprintf work not right if it is pending To: Yao Qi Cc: Hui Zhu , gdb-patches ml , Marc Khouzam Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-03/txt/msg00911.txt.bz2 On Fri, Mar 22, 2013 at 7:12 PM, Yao Qi wrote: > On 03/22/2013 02:16 PM, Hui Zhu wrote: >> >> The dprintf's commands is setup in function init_breakpoint_sal: >> /* Dynamic printf requires and uses additional arguments on the >> command line, otherwise it's an error. */ >> if (type =3D=3D bp_dprintf) >> { >> if (b->extra_string) > > > "b->extra_string !=3D NULL" is encouraged nowadays. Thanks for your remind. I get a lot of review like this, do we have some doc for that. I checked the "gnu code stand" but I didn't find it. > > >> update_dprintf_command_list (b); >> else >> error (_("Format string required")); >> } >> else if (b->extra_string) >> error (_("Garbage '%s' at end of command"), b->extra_string); >> >> But if the dprintf is pending. When it reset by function bkpt_re_set, >> there is not code to code to update extra_string to commands. >> So I add this code to function update_breakpoint_locations. The issue is >> fixed. > > > The bug was reported in PR breakpoints/15292: Pending dprintf don't > work. > > We need a test case here, I think, to show pending dprintf doesn't > work, and it works with your patch applied. > > I am wondering whether we need a new breakpoint_ops field > "parse_extra_string", and use it like: > > b->ops->parse_extra_string (b, extra_string); > > instead of duplicate the code. > > -- > Yao (=E9=BD=90=E5=B0=A7)