From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31633 invoked by alias); 22 Mar 2013 11:13:54 -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 31254 invoked by uid 89); 22 Mar 2013 11:13:03 -0000 X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 22 Mar 2013 11:13:00 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UIzu6-0007IW-QH from Yao_Qi@mentor.com ; Fri, 22 Mar 2013 04:12:58 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 22 Mar 2013 04:12:58 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Fri, 22 Mar 2013 04:12:57 -0700 Message-ID: <514C3C85.4000704@codesourcery.com> Date: Fri, 22 Mar 2013 12:40:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Hui Zhu CC: gdb-patches ml , Marc Khouzam Subject: Re: [PATCH] Fix dprintf work not right if it is pending References: <514BF736.3070706@mentor.com> In-Reply-To: <514BF736.3070706@mentor.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2013-03/txt/msg00835.txt.bz2 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 == bp_dprintf) > { > if (b->extra_string) "b->extra_string != NULL" is encouraged nowadays. > 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 (齐尧)