aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2017-11-21 14:10:01 -0800
committerJoel Brobecker <brobecker@adacore.com>2017-11-21 14:34:30 -0800
commit3b1b69bffe522f22d269723856d2caa901041819 (patch)
tree816a0470eab36a5e3a5c930021f8230366db95de
parent54aa6c67f5a0d52dabd428cc40ce02781032acd3 (diff)
downloadgdb-3b1b69bffe522f22d269723856d2caa901041819.zip
gdb-3b1b69bffe522f22d269723856d2caa901041819.tar.gz
gdb-3b1b69bffe522f22d269723856d2caa901041819.tar.bz2
ravenscar: update inferior ptid with event ptid
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.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ravenscar-thread.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index eb4b03e..1c77dea 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 00593b8..30745f7 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -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 ();
}