]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ravenscar: update inferior ptid with event ptid
authorJerome Guitton <guitton@adacore.com>
Tue, 21 Nov 2017 22:10:01 +0000 (14:10 -0800)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 21 Nov 2017 22:34:30 +0000 (14:34 -0800)
When debugging a program using a ravenscar runtime, the thread
layer sometimes gets confused, and even missing some threads.
This was traced to an assumption that ravenscar_wait was making,
which is that calling the "to_wait" target_ops method would
set the inferior_ptid, so that we could then use that assumption
to update our thread_list and current ptid. However, this has not
been the case for quite a while now. This patch fixes the problem
by assigning inferior_ptid the ptid returned by "to_wait".

gdb/ChangeLog:

* ravenscar-thread.c (ravenscar_wait): Update inferior ptid
with event ptid from the lower layer before doing the
ravenscar-specific update.

gdb/ChangeLog
gdb/ravenscar-thread.c

index eb4b03ea4bc757545b0216a3903b4bb57364d4ea..1c77dea873e582e277fdd62f49fdf7ff557b1b9d 100644 (file)
@@ -1,3 +1,9 @@
+2017-11-21  Jerome Guitton  <guitton@adacore.com>
+
+       * ravenscar-thread.c (ravenscar_wait): Update inferior ptid
+       with event ptid from the lower layer before doing the
+       ravenscar-specific update.
+
 2017-11-21  Joel Brobecker  <brobecker@adacore.com>
 
        * ravenscar-thread.c (is_ravenscar_task): Also verify that
index 00593b84db6d2f2ab2ac3eaa5c69dbc4747ddd04..30745f7caacc03f8b0f37b7aa12266e92d1e7636 100644 (file)
@@ -297,9 +297,10 @@ ravenscar_wait (struct target_ops *ops, ptid_t ptid,
                 int options)
 {
   struct target_ops *beneath = find_target_beneath (ops);
+  ptid_t event_ptid;
 
   inferior_ptid = base_ptid;
-  beneath->to_wait (beneath, base_ptid, status, 0);
+  event_ptid = beneath->to_wait (beneath, base_ptid, status, 0);
   /* Find any new threads that might have been created, and update
      inferior_ptid to the active thread.
 
@@ -310,6 +311,7 @@ ravenscar_wait (struct target_ops *ops, ptid_t ptid,
   if (status->kind != TARGET_WAITKIND_EXITED
       && status->kind != TARGET_WAITKIND_SIGNALLED)
     {
+      inferior_ptid = event_ptid;
       ravenscar_update_thread_list (ops);
       ravenscar_update_inferior_ptid ();
     }