/* Ada Ravenscar thread support.
- Copyright (C) 2004-2019 Free Software Foundation, Inc.
+ Copyright (C) 2004-2020 Free Software Foundation, Inc.
This file is part of GDB.
is running, switching to its corresponding ptid, and then performing
the operation on that ptid using the target beneath us. */
-/* If non-null, ravenscar task support is enabled. */
-static int ravenscar_task_support = 1;
+/* If true, ravenscar task support is enabled. */
+static bool ravenscar_task_support = true;
static const char running_thread_name[] = "__gnat_running_thread_table";
void
ravenscar_thread_target::update_inferior_ptid ()
{
+ process_stratum_target *proc_target
+ = as_process_stratum_target (this->beneath ());
+
int base_cpu;
m_base_ptid = inferior_ptid;
/* The running thread may not have been added to
system.tasking.debug's list yet; so ravenscar_update_thread_list
may not always add it to the thread list. Add it here. */
- if (!find_thread_ptid (inferior_ptid))
- add_thread (inferior_ptid);
+ if (!find_thread_ptid (proc_target, inferior_ptid))
+ add_thread (proc_target, inferior_ptid);
}
/* The Ravenscar Runtime exports a symbol which contains the ID of
struct target_waitstatus *status,
int options)
{
+ process_stratum_target *beneath
+ = as_process_stratum_target (this->beneath ());
ptid_t event_ptid;
inferior_ptid = m_base_ptid;
if (ptid != minus_one_ptid)
ptid = m_base_ptid;
- event_ptid = beneath ()->wait (ptid, status, 0);
+ event_ptid = beneath->wait (ptid, status, 0);
/* Find any new threads that might have been created, and update
inferior_ptid to the active thread.
static void
ravenscar_add_thread (struct ada_task_info *task)
{
- if (find_thread_ptid (task->ptid) == NULL)
- add_thread (task->ptid);
+ if (find_thread_ptid (current_inferior (), task->ptid) == NULL)
+ add_thread (current_inferior ()->process_target (), task->ptid);
}
void