Message ID | 1455150383-12456-1-git-send-email-donb@codesourcery.com |
---|---|
State | New |
Headers | show |
Hi Don, On 02/11/2016 12:26 AM, Don Breazeal wrote: > On 2/1/2016 12:38 PM, Pedro Alves wrote: >> So the fork event has been reported out of target_wait but it was >> left pending on the infrun side (infrun.c:save_waitstatus) >> >> IOW, the fork event hasn't been processed by handle_inferior_event >> yet, so it hasn't made it to tp->pending_follow yet. >> >> The information is not lost, we're just looking for it in the >> wrong place. I think this would be the right fix: > > The fix below is essentially unchanged from your suggested fix. The commit > message has been updated for the new fix. > > Tested on Nios II Linux target with x86 Linux host, and native x86_64 Linux. OK. Fine for 7.11 as well. I'll need a bit more to think over patches 2 and 3. Thanks, Pedro Alves
On 2/12/2016 12:15 PM, Pedro Alves wrote: > Hi Don, > > On 02/11/2016 12:26 AM, Don Breazeal wrote: > >> On 2/1/2016 12:38 PM, Pedro Alves wrote: > >>> So the fork event has been reported out of target_wait but it was >>> left pending on the infrun side (infrun.c:save_waitstatus) >>> >>> IOW, the fork event hasn't been processed by handle_inferior_event >>> yet, so it hasn't made it to tp->pending_follow yet. >>> >>> The information is not lost, we're just looking for it in the >>> wrong place. I think this would be the right fix: >> >> The fix below is essentially unchanged from your suggested fix. The commit >> message has been updated for the new fix. >> >> Tested on Nios II Linux target with x86 Linux host, and native x86_64 Linux. > > OK. Fine for 7.11 as well. > > I'll need a bit more to think over patches 2 and 3. > > Thanks, > Pedro Alves > Thanks Pedro. Patch 1 is now pushed to mainline and 7.11. --Don
diff --git a/gdb/remote.c b/gdb/remote.c index 6d56f19..f09a06e 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6166,7 +6166,12 @@ remove_new_fork_children (struct threads_listing_context *context) fork child threads from the CONTEXT list. */ ALL_NON_EXITED_THREADS (thread) { - struct target_waitstatus *ws = &thread->pending_follow; + struct target_waitstatus *ws; + + if (thread->suspend.waitstatus_pending_p) + ws = &thread->suspend.waitstatus; + else + ws = &thread->pending_follow; if (is_pending_fork_parent (ws, pid, thread->ptid)) { diff --git a/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp b/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp index 6c72061..ff3ca9a 100644 --- a/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp +++ b/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp @@ -100,12 +100,6 @@ proc do_test { cond_bp_target detach_on_fork displaced } { set fork_count 0 set ok 0 - if {$displaced == "off" - && [target_info exists gdb_protocol] - && ([target_info gdb_protocol] == "remote" - || [target_info gdb_protocol] == "extended-remote")} { - setup_kfail "remote/19496" *-*-* - } set test "inferior 1 exited" gdb_test_multiple "" $test { -re "Inferior 1 \(\[^\r\n\]+\) exited normally" {