RFA: fix PR breakpoints/13776

Doug Evans dje@google.com
Tue Feb 28 21:05:00 GMT 2012


On Tue, Feb 28, 2012 at 9:26 AM, Tom Tromey <tromey@redhat.com> wrote:
> I'd appreciate comments on this patch.
> [...]
> This patch fixes this problem by moving the breakpoint_init_inferior
> call earlier in generic_mourn_inferior.  This causes the breakpoints to
> be marked as uninserted before they are deleted.
> [...]
> diff --git a/gdb/target.c b/gdb/target.c
> index 1f408f6..65a6c23 100644
> --- a/gdb/target.c
> +++ b/gdb/target.c
> @@ -3583,13 +3583,14 @@ generic_mourn_inferior (void)
>   ptid = inferior_ptid;
>   inferior_ptid = null_ptid;
>
> +  breakpoint_init_inferior (inf_exited);
> +
>   if (!ptid_equal (ptid, null_ptid))
>     {
>       int pid = ptid_get_pid (ptid);
>       exit_inferior (pid);
>     }
>
> -  breakpoint_init_inferior (inf_exited);
>   registers_changed ();
>
>   reopen_exec_file ();

A comment right before the new breakpoint_init_inferior call to
explain why it lives there would be useful to future readers of the
code.



More information about the Gdb-patches mailing list