From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7633 invoked by alias); 24 Mar 2013 12:05: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 7584 invoked by uid 89); 24 Mar 2013 12:05:28 -0000 X-Spam-SWARE-Status: No, score=-7.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,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; Sun, 24 Mar 2013 12:05:26 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2OC5KuV014764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 24 Mar 2013 08:05:21 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2OC5Jtr005596 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 24 Mar 2013 08:05:20 -0400 Message-ID: <514EEBFF.8090705@redhat.com> Date: Mon, 25 Mar 2013 01:00:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Hui Zhu CC: Yao Qi , gdb-patches ml , Marc Khouzam Subject: Re: [PATCH] Fix dprintf work not right if it is pending References: <514BF736.3070706@mentor.com> <514C3C85.4000704@codesourcery.com> In-Reply-To: <514C3C85.4000704@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-03/txt/msg00898.txt.bz2 On 03/22/2013 04:12 AM, Yao Qi wrote: >> 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. I agree: special handling is necessary, but I don't care for either of these solutions. The original proposal clutters generic breakpoint code with dprintf-specific handling. As Yao correctly points out, this is what the breakpoint ops vector is for. However, I don't like the idea of adding a new "parse_extra_string" method. It is far too vague. Parse extra_string when? I think the better solution, and one which we already have the infrastructure for, is to define a dprintf_re_set method in the dprintf's breakpoint ops, updating the command list whenever a pending breakpoint is resolved. This definitely needs a test. Keith