+2020-08-07 Tom Tromey <tromey@adacore.com>
+
+ * ravenscar-thread.c (ravenscar_thread_target): Don't call
+ add_active_thread.
+ (ravenscar_thread_target::add_active_thread): Now public.
+ (ravenscar_inferior_created): Call add_active_thread after pushing
+ the target.
+
2020-08-07 Simon Marchi <simon.marchi@polymtl.ca>
* regcache.c (ptid_regcache_map): New type.
ravenscar_thread_target ()
: m_base_ptid (inferior_ptid)
{
- thread_info *thr = add_active_thread ();
- if (thr != nullptr)
- switch_to_thread (thr);
}
const target_info &info () const override
delete this;
}
+ thread_info *add_active_thread ();
+
private:
/* PTID of the last thread that received an event.
the event, to make it the current task. */
ptid_t m_base_ptid;
- thread_info *add_active_thread ();
ptid_t active_task (int cpu);
bool task_is_currently_active (ptid_t ptid);
bool runtime_initialized ();
return;
}
- target_ops_up target_holder (new ravenscar_thread_target ());
- push_target (std::move (target_holder));
+ ravenscar_thread_target *rtarget = new ravenscar_thread_target ();
+ push_target (target_ops_up (rtarget));
+ thread_info *thr = rtarget->add_active_thread ();
+ if (thr != nullptr)
+ switch_to_thread (thr);
}
ptid_t