diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ravenscar-thread.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b833d34..eb4b03e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2017-11-21 Joel Brobecker <brobecker@adacore.com> + * ravenscar-thread.c (is_ravenscar_task): Also verify that + the ptid's TID is nonzero. + +2017-11-21 Joel Brobecker <brobecker@adacore.com> + * ada-lang.h (ada_get_tcb_types_info): Add declaration. * ada-tasks.c (ada_get_tcb_types_info): Renames get_tcb_types_info. Make non-static. Change return type to char *. Adjust code diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index e792227..00593b8 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -101,8 +101,14 @@ static void ravenscar_inferior_created (struct target_ops *target, static int is_ravenscar_task (ptid_t ptid) { - /* By construction, ravenscar tasks have their LWP set to zero. */ - return ptid_get_lwp (ptid) == 0; + /* By construction, ravenscar tasks have their LWP set to zero. + Also make sure that the TID is nonzero, as some remotes, when + asked for the list of threads, will return the first thread + as having its TID set to zero. For instance, TSIM version + 2.0.48 for LEON3 sends 'm0' as a reply to the 'qfThreadInfo' + query, which the remote protocol layer then treats as a thread + whose TID is 0. This is obviously not a ravenscar task. */ + return ptid_get_lwp (ptid) == 0 && ptid_get_tid (ptid) != 0; } /* Given PTID, which can be either a ravenscar task or a CPU thread, |