gdb/
authorPedro Alves <palves@redhat.com>
Fri, 2 Nov 2012 18:13:37 +0000 (18:13 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 2 Nov 2012 18:13:37 +0000 (18:13 +0000)
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".

gdb/ChangeLog
gdb/infrun.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/foll-vfork.exp

index adcdb978d98472d7f0bac03d3e3a50ad21c62635..95e7777aa4808d29176634b440fa4a5e523adc62 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2012-11-02  Yao Qi  <yao@codesourcery.com>
 
        * std-operator.def: Remove OP_LABELED.
index d79c6bd1b3ea6c60511afbf8b1e4e18d5e68fcc0..ab5aacf584da9fd1da9dc5270b5c157c5b2fea63 100644 (file)
@@ -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);
index e7e42d8e0dbc9af3beeb8dc39a1808b011084a46..91287e34ae7592769b6e6bfb89dce4e1c47b28cf 100644 (file)
@@ -1,3 +1,12 @@
+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".
+
 2012-11-02  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/foll-vfork-exit.c: New file.
index 9515d1618ec3b05087fc2d6aa16c433455a76159..0b2eee69e30d2e95e480a241f3b03da4ba391dd6 100644 (file)
@@ -164,7 +164,7 @@ proc vfork_child_follow_to_exit {} {
    set test "continue to child exit"
    gdb_test_multiple "continue" $test {
       -re "Couldn't get registers.*$gdb_prompt " {
-         setup_kfail "gdb/14766" *-*-*
+         # PR gdb/14766
          fail "$test"
       }
       -re "Attaching after.* vfork to.*Detaching vfork parent .* after child exit.*$gdb_prompt " {
@@ -369,10 +369,6 @@ proc tcatch_vfork_then_child_follow_exit {} {
 
    set test "finish"
    gdb_test_multiple "finish" $test {
-      -re "Couldn't get registers.*$gdb_prompt " {
-         setup_kfail "gdb/14766" *-*-*
-         fail "$test "
-      }
       -re "Run till exit from.*vfork.*exited normally.*$gdb_prompt " {
          setup_kfail "gdb/14762" *-*-*
          fail $test