Fix usage of inferior_ptid in two thread_alive implementations
authorSimon Marchi <simon.marchi@ericsson.com>
Thu, 23 Feb 2017 15:36:20 +0000 (10:36 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Thu, 23 Feb 2017 15:36:20 +0000 (10:36 -0500)
While inspecting some target code, I noticed that in these two
implementations of thread_alive, inferior_ptid is referenced directly
instead of using the ptid passed as parameters.  I guess that it is
wrong, although I can't really test it in both cases.

gdb/ChangeLog:

* bsd-uthread.c (bsd_uthread_thread_alive): Use ptid instead of
inferior_ptid.
* go32-nat.c (go32_thread_alive): Likewise.

gdb/ChangeLog
gdb/bsd-uthread.c
gdb/go32-nat.c

index 6cc163b3dee5fb111fac88aaffd5c9050ebb384e..30cd5767d8aff8f48e44f935259d146cca981502 100644 (file)
@@ -1,3 +1,9 @@
+2017-02-23  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * bsd-uthread.c (bsd_uthread_thread_alive): Use ptid instead of
+       inferior_ptid.
+       * go32-nat.c (go32_thread_alive): Likewise.
+
 2017-02-23  Yao Qi  <yao.qi@linaro.org>
 
        * varobj-iter.h (varobj_iter_delete): Call xfree instead of
index 41c7d59be192c50436b18779e469776a7c10dae4..20eecd38799e7cc985b663929e559d39661b0e8e 100644 (file)
@@ -401,7 +401,7 @@ bsd_uthread_thread_alive (struct target_ops *ops, ptid_t ptid)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   struct target_ops *beneath = find_target_beneath (ops);
-  CORE_ADDR addr = ptid_get_tid (inferior_ptid);
+  CORE_ADDR addr = ptid_get_tid (ptid);
 
   if (addr != 0)
     {
index 3e9e99f068c6c338c52b498e245cc21c2e6c7406..1fca8e2e53f83e236260e984dc803825bb60781c 100644 (file)
@@ -938,7 +938,7 @@ go32_terminal_ours (struct target_ops *self)
 static int
 go32_thread_alive (struct target_ops *ops, ptid_t ptid)
 {
-  return !ptid_equal (inferior_ptid, null_ptid);
+  return !ptid_equal (ptid, null_ptid);
 }
 
 static char *
This page took 0.027143 seconds and 4 git commands to generate.