[binutils-gdb] Don't write to inferior_ptid in aix-thread.c

Pedro Alves palves@sourceware.org
Thu Jun 18 22:27:53 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6dbdab44e57d21c895ef60246d0e7aadb3c076a4

commit 6dbdab44e57d21c895ef60246d0e7aadb3c076a4
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Jun 18 21:28:36 2020 +0100

    Don't write to inferior_ptid in aix-thread.c
    
    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.

Diff:
---
 gdb/ChangeLog    | 4 ++++
 gdb/aix-thread.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2f153820312..cd2af5c7a00 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index f2bd05fef22..3963a08c840 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -902,7 +902,7 @@ pd_update (int set_infpid)
     {
       ptid = thread->ptid;
       if (set_infpid)
-	inferior_ptid = ptid;
+	switch_to_thread (thread);
     }
   return ptid;
 }


More information about the Gdb-cvs mailing list