Don't write to inferior_ptid in aix-thread.c
authorPedro Alves <palves@redhat.com>
Thu, 18 Jun 2020 20:28:36 +0000 (21:28 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 18 Jun 2020 22:18:08 +0000 (23:18 +0100)
There are other writes in the file, but they seem more harmless.  This
one is changing the current thread permanently.

gdb/ChangeLog:
2020-06-18  Pedro Alves  <palves@redhat.com>

* aix-thread.c (pd_update): Use switch_to_thread.

gdb/ChangeLog
gdb/aix-thread.c

index 2f153820312ef6eaf625167991a16c2abd91b385..cd2af5c7a00f4c00885552adab5358976f6242d9 100644 (file)
@@ -1,3 +1,7 @@
+2020-06-18  Pedro Alves  <palves@redhat.com>
+
+       * aix-thread.c (pd_update): Use switch_to_thread.
+
 2020-06-18  Pedro Alves  <palves@redhat.com>
 
        * ravenscar-thread.c (ravenscar_thread_target): Update.
index f2bd05fef22b4d0f846a9aa21d2c90f642153400..3963a08c840bc27ec052b10e1c2d71dc03381f81 100644 (file)
@@ -902,7 +902,7 @@ pd_update (int set_infpid)
     {
       ptid = thread->ptid;
       if (set_infpid)
-       inferior_ptid = ptid;
+       switch_to_thread (thread);
     }
   return ptid;
 }