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: Yao Qi <yao at codesourcery dot com>
- To: Hui Zhu <hui_zhu at mentor dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>, Marc Khouzam <marc dot khouzam at ericsson dot com>
- Date: Fri, 22 Mar 2013 19:12:05 +0800
- Subject: Re: [PATCH] Fix dprintf work not right if it is pending
- References: <514BF736 dot 3070706 at mentor dot com>
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 (éå)