[PATCH] Fix dprintf work not right if it is pending
Hui Zhu
teawater@gmail.com
Mon Mar 25 08:25:00 GMT 2013
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 (齐尧)
More information about the Gdb-patches
mailing list