summaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-11-02 18:13:34 +0000
committerPedro Alves <palves@redhat.com>2012-11-02 18:13:34 +0000
commit720915dfa0bd0b95a4a709850a94a39e57e67498 (patch)
treec294cabc7b278ec44c0d63bf78c2054d3befaa2d /gdb/infrun.c
parent2e2051fc8b1022775822e8f5b4a16fcfcc394907 (diff)
downloadgdb-720915dfa0bd0b95a4a709850a94a39e57e67498.tar.gz
gdb/
2012-11-02 Pedro Alves <palves@redhat.com> PR gdb/14766 * infrun.c (handle_inferior_event) <TARGET_WAITKIND_EXITED/TARGET_WAITKIND_SIGNALLED>: Switch to null_ptid before handling a vfork child exec or exit. Switch to the event ptid afterwards. gdb/testsuite/ 2012-11-02 Pedro Alves <palves@redhat.com> PR gdb/14766 * gdb.base/foll-vfork.exp (vfork_child_follow_to_exit): Remove setup_kfail. (tcatch_vfork_then_child_follow_exit): No longer expect "Couldn't get registers".
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d79c6bd1b3e..ab5aacf584d 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -663,7 +663,16 @@ handle_vfork_child_exec_or_exit (int exec)
/* follow-fork child, detach-on-fork on. */
- old_chain = make_cleanup_restore_current_thread ();
+ if (!exec)
+ {
+ /* If we're handling a child exit, then inferior_ptid
+ points at the inferior's pid, not to a thread. */
+ old_chain = save_inferior_ptid ();
+ save_current_program_space ();
+ save_current_inferior ();
+ }
+ else
+ old_chain = save_current_space_and_thread ();
/* We're letting loose of the parent. */
tp = any_live_thread_of_process (inf->vfork_parent->pid);