This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] PR 15075 dprintf interferes with "next"
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 18 Feb 2013 13:36:41 -0800
- Subject: Re: [RFC] PR 15075 dprintf interferes with "next"
- References: <1361192891-29341-1-git-send-email-yao@codesourcery.com>
> I'd like to get your comments on this patch, as I think my patch is
> hacky but I am unable to figure out a correct one. This patch fixes more
> problems than PR 15075 mentioned, they are,
>
> - When step a source line by "next" command, and there is a dprintf
> on that line, "next" command will behave like "continue".
> - Two dprintf are set on the same address. Only one printf is
> executed.
> - dprintf and regular breakpoint are set on the same address,
> inferior doesn't stop.
>
> In order to fix these problems, I don't append "continue" command to
> dprintf breakpoint, and after all commands of all breakpoints (caused
> the stop) are executed, execute "continue" command if
> 1) the inferior is not proceeded by these commands
> 2) and the stop is only caused by dprintf (no other types of
> breakpoint)
> 3) the inferior is not in the state of stepping a source line or
> an instruction (to fix PR 15075).
>
> My patch fixes all the three known problems, but I think it is still
> hacky.
My first reaction is that we'd better just byte the bullet, and
implement this properly. In my opinion, something at the infrun/
handle_inferior_event level... Pedro is a specialist of the dreaded
handle_inferior_event function, so he might have a more precise
suggestion.
Interestingly enough, I did point out these limitations, but we still
went ahead, as we thought that the feature would be useful...
--
Joel