]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't compare the pid returned from 'wait' against inferior_ptid.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 9 Jul 2020 19:40:40 +0000 (12:40 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 9 Jul 2020 19:40:40 +0000 (12:40 -0700)
'inf_ptrace::wait' needs to discard termination events reported by
detached child processes.  Previously it compared the returned pid
against the pid in inferior_ptid to determine if a termination event
should be discarded or reported.  The multi-target changes cleared
inferior_ptid to null_ptid in 'wait' target methods, so this was
always failing and never reporting exit events.  Instead, report
termination events whose pid matches any inferior belonging to the
current target.

Several tests started failing on FreeBSD after the multi-target
changes and pass again after this change.

gdb/ChangeLog:

* inf-ptrace.c (inf_ptrace_target::wait): Don't compare against
inferior_ptid.

gdb/ChangeLog
gdb/inf-ptrace.c

index 40e22efd7eb6749574727dc13e75de2224981213..bdab91dd2d626f8c7a5753f5bc27083185a7f55d 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-09  John Baldwin  <jhb@FreeBSD.org>
+
+       * inf-ptrace.c (inf_ptrace_target::wait): Don't compare against
+       inferior_ptid.
+
 2020-07-09  John Baldwin  <jhb@FreeBSD.org>
 
        * fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_ARGC,
index d25d226abba474faeb0e79204440f601c3bec645..ae0b0f7ff0d50c1f77220636d13a0b515849d86d 100644 (file)
@@ -347,7 +347,7 @@ inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
        }
 
       /* Ignore terminated detached child processes.  */
-      if (!WIFSTOPPED (status) && pid != inferior_ptid.pid ())
+      if (!WIFSTOPPED (status) && find_inferior_pid (this, pid) == nullptr)
        pid = -1;
     }
   while (pid == -1);