Re: Fix execl.exp sporadic failures

Daniel Jacobowitz
2008-07-07T19:10:59Z

On Thu, Jul 03, 2008 at 01:43:08AM +0100, Pedro Alves wrote:
> 2008-07-03 Pedro Alves <pedro@codesourcery.com>
>
> * breakpoint.c (mark_breakpoints_out): Make public.
> (update_breakpoints_after_exec): Don't call mark_breakpoints_out
> here. Update comment.
> * breakpoint.h (mark_breakpoints_out): Declare.
>
> * linux-nat.c (linux_handle_extended_wait): On
> TARGET_WAITKIND_EXECD, call mark_breakpoints_out.
> * inf-ttrace.c (inf_ttrace_wait): Likewise.

I don't like this patch - it duplicates knowledge into each GDB
target that should be global - but your logic is sound. It's OK.
> + /* There used to be a call to mark_breakpoints_out here with the
> + following comment:
> +
> + Doing this first prevents the badness of having
> + delete_breakpoint() write a breakpoint's current "shadow
> + contents" to lift the bp. That shadow is NOT valid after an
> + exec()!
> +
> + The concern is valid, but it was found that there are logical
> + places to delete breakpoints after detecting an exec and before
> + reaching here. The call has since moved closer to where the each
> + target detects an exec. */
> +

Please remove this comment, or write one that describes the current
state (bonus points for an assertion). Comments that describe how GDB
used to be grow more confusing with their age.

> /* The binary we used to debug is now gone, and we're updating
> breakpoints for the new binary. Until we're done, we should not

This comment is now out of date, but it's removed by the other patch I
just approved, very nice :-)

--
Daniel Jacobowitz
CodeSourcery