This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix dprintf work not right if it is pending
- From: Hui Zhu <teawater at gmail dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: Hui Zhu <hui_zhu at mentor dot com>, gdb-patches ml <gdb-patches at sourceware dot org>, Marc Khouzam <marc dot khouzam at ericsson dot com>
- Date: Mon, 25 Mar 2013 12:07:53 +0800
- Subject: Re: [PATCH] Fix dprintf work not right if it is pending
- References: <514BF736 dot 3070706 at mentor dot com> <514C3C85 dot 4000704 at codesourcery dot com>
On Fri, Mar 22, 2013 at 7:12 PM, Yao Qi <yao@codesourcery.com> 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 == bp_dprintf)
>> {
>> if (b->extra_string)
>
>
> "b->extra_string != 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 (éå)