aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-03-02 19:26:10 +0000
committerPedro Alves <palves@redhat.com>2012-03-02 19:26:10 +0000
commitf59f708a4b12a347cb003c750b96336822481900 (patch)
tree5d55c5e6edd298646d04e416ea15904a9cf8ea62 /gdb/target.c
parent44099a67be4e2b30f29c14cb38ca171ff8a3beda (diff)
downloadgdb-f59f708a4b12a347cb003c750b96336822481900.zip
gdb-f59f708a4b12a347cb003c750b96336822481900.tar.gz
gdb-f59f708a4b12a347cb003c750b96336822481900.tar.bz2
2012-03-02 Tom Tromey <tromey@redhat.com>
Pedro Alves <palves@redhat.com> PR breakpoints/13776: * breakpoint.c (breakpoint_init_inferior): Delete step-resume breakpoints. (delete_longjmp_breakpoint_at_next_stop): New. * breakpoint.h (delete_longjmp_breakpoint_at_next_stop): Declare. * target.c (generic_mourn_inferior): Call mark_breakpoints_out before deleting the inferior. Add comments. * thread.c (clear_thread_inferior_resources): Don't delete lonjmp breakpoints immediately, but only on next stop. Move that code next to where we mark other breakpoints for deletion.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 1f408f6..d29d37a 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3583,13 +3583,22 @@ generic_mourn_inferior (void)
ptid = inferior_ptid;
inferior_ptid = null_ptid;
+ /* Mark breakpoints uninserted in case something tries to delete a
+ breakpoint while we delete the inferior's threads (which would
+ fail, since the inferior is long gone). */
+ mark_breakpoints_out ();
+
if (!ptid_equal (ptid, null_ptid))
{
int pid = ptid_get_pid (ptid);
exit_inferior (pid);
}
+ /* Note this wipes step-resume breakpoints, so needs to be done
+ after exit_inferior, which ends up referencing the step-resume
+ breakpoints through clear_thread_inferior_resources. */
breakpoint_init_inferior (inf_exited);
+
registers_changed ();
reopen_exec_file ();