From: Pedro Alves Date: Thu, 11 Dec 2008 19:19:12 +0000 (+0000) Subject: * infrun.c (handle_inferior_event): On a TARGET_WAITKIND_EXITED or X-Git-Tag: sid-snapshot-20090201~482 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb66883a82873544d46dac3d3850915d10ca5e94;p=external%2Fbinutils.git * infrun.c (handle_inferior_event): On a TARGET_WAITKIND_EXITED or TARGET_WAITKIND_SIGNALLED, switch inferior_ptid to the event ptid. * linux_thread_db.c (thread_db_wait): On a TARGET_WAITKIND_EXITED or TARGET_WAITKIND_SIGNALLED, return the ptid the beneath target returned. * inf-ptrace.c (inf_ptrace_wait): Return inferior_ptid instead of minus_one_ptid if the inferior disappeared. * rs6000-nat.c (rs6000_wait): Likewise. * spu-linux-nat.c (spu_child_wait): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f157b5a..29839cd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2008-12-11 Pedro Alves + + * infrun.c (handle_inferior_event): On a TARGET_WAITKIND_EXITED or + TARGET_WAITKIND_SIGNALLED, switch inferior_ptid to the event ptid. + * linux_thread_db.c (thread_db_wait): On a TARGET_WAITKIND_EXITED + or TARGET_WAITKIND_SIGNALLED, return the ptid the beneath target + returned. + * inf-ptrace.c (inf_ptrace_wait): Return inferior_ptid instead of + minus_one_ptid if the inferior disappeared. + * rs6000-nat.c (rs6000_wait): Likewise. + * spu-linux-nat.c (spu_child_wait): Likewise. + 2008-12-11 Tom Tromey PR macros/2564: diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index bf3d0a8..7bdf2fa 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -410,7 +410,7 @@ inf_ptrace_wait (ptid_t ptid, struct target_waitstatus *ourstatus) /* Claim it exited with unknown signal. */ ourstatus->kind = TARGET_WAITKIND_SIGNALLED; ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN; - return minus_one_ptid; + return inferior_ptid; } /* Ignore terminated detached child processes. */ diff --git a/gdb/infrun.c b/gdb/infrun.c index 6054950..e65704a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2271,6 +2271,7 @@ handle_inferior_event (struct execution_control_state *ecs) case TARGET_WAITKIND_EXITED: if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_EXITED\n"); + inferior_ptid = ecs->ptid; target_terminal_ours (); /* Must do this before mourn anyway */ print_stop_reason (EXITED, ecs->ws.value.integer); @@ -2289,6 +2290,7 @@ handle_inferior_event (struct execution_control_state *ecs) case TARGET_WAITKIND_SIGNALLED: if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_SIGNALLED\n"); + inferior_ptid = ecs->ptid; stop_print_frame = 0; target_terminal_ours (); /* Must do this before mourn anyway */ diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 5f98e99..cf0dd6a 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -888,8 +888,8 @@ thread_db_wait (ptid_t ptid, struct target_waitstatus *ourstatus) return ptid; if (ourstatus->kind == TARGET_WAITKIND_EXITED - || ourstatus->kind == TARGET_WAITKIND_SIGNALLED) - return pid_to_ptid (-1); + || ourstatus->kind == TARGET_WAITKIND_SIGNALLED) + return ptid; if (ourstatus->kind == TARGET_WAITKIND_EXECD) { diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 6501def..efdfaa6 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -546,7 +546,7 @@ rs6000_wait (ptid_t ptid, struct target_waitstatus *ourstatus) /* Claim it exited with unknown signal. */ ourstatus->kind = TARGET_WAITKIND_SIGNALLED; ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN; - return minus_one_ptid; + return inferior_ptid; } /* Ignore terminated detached child processes. */ diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c index 5d76300..7223a96 100644 --- a/gdb/spu-linux-nat.c +++ b/gdb/spu-linux-nat.c @@ -444,7 +444,7 @@ spu_child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) /* Claim it exited with unknown signal. */ ourstatus->kind = TARGET_WAITKIND_SIGNALLED; ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN; - return minus_one_ptid; + return inferior_ptid; } store_waitstatus (ourstatus, status);