This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix dprintf work not right if it is pending


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]