Make the ravenscar thread target multi-target-ready
authorTom Tromey <tromey@adacore.com>
Wed, 6 Feb 2019 10:06:49 +0000 (03:06 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 15 Feb 2019 20:53:43 +0000 (13:53 -0700)
commit0b790b1eeb3741217d4b7b419aca1ed77a114b6c
tree4f94626e8eb755fdec280fa26fe9c53b546c90d4
parentdea57a626364698759d1525acf9109771d173811
Make the ravenscar thread target multi-target-ready

This changes ravenscar-thread.c to make it ready for multi-target.
This is done by moving globals into the target, and then arranging to
allocate the target with "new" and delete the target in its "close"
method.

gdb/ChangeLog
2019-02-15  Tom Tromey  <tromey@adacore.com>

* ravenscar-thread.c (base_ptid): Remove.
(struct ravenscar_thread_target) <close>: New method.
<m_base_ptid>: New member.
<update_inferior_ptid, active_task, task_is_currently_active,
runtime_initialized>: Declare methods.
<ravenscar_thread_target>: Add constructor.
(ravenscar_thread_target::task_is_currently_active)
(ravenscar_thread_target::update_inferior_ptid)
(ravenscar_runtime_initialized): Rename.  Now methods.
(ravenscar_thread_target::resume, ravenscar_thread_target::wait)
(ravenscar_thread_target::update_thread_list): Update.
(ravenscar_thread_target::active_task): Now method.
(ravenscar_thread_target::store_registers)
(ravenscar_thread_target::prepare_to_store)
(ravenscar_thread_target::prepare_to_store)
(ravenscar_thread_target::mourn_inferior): Update.
(ravenscar_inferior_created): Use "new" to create target.
(ravenscar_thread_target::get_ada_task_ptid): Update.
(_initialize_ravenscar): Don't initialize base_ptid.
(ravenscar_ops): Remove global.
gdb/ChangeLog
gdb/ravenscar-thread.c