This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA 1/8] Call update_inferior_ptid after pushing the ravenscar target


Currently ravenscar-thread.c calls update_inferior_ptid before pushing
the ravenscar target.  This yields an initial thread announcement of
"[Thread 0]".  Calling update_inferior_ptid after pushing the target
fixes this.

gdb/ChangeLog
2019-03-26  Tom Tromey  <tromey@adacore.com>

	* ravenscar-thread.c (ravenscar_thread_target): Don't call
	update_inferior_ptid.
	(ravenscar_thread_target::update_inferior_ptid): Now public.
	(ravenscar_inferior_created): Call update_inferior_ptid after
	pushing the target.
---
 gdb/ChangeLog          | 8 ++++++++
 gdb/ravenscar-thread.c | 9 +++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 6636a89554b..225bffcb65a 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -78,7 +78,6 @@ struct ravenscar_thread_target final : public target_ops
 {
   ravenscar_thread_target ()
   {
-    update_inferior_ptid ();
   }
 
   const target_info &info () const override
@@ -121,6 +120,8 @@ struct ravenscar_thread_target final : public target_ops
     delete this;
   }
 
+  void update_inferior_ptid ();
+
 private:
 
   /* PTID of the last thread that received an event.
@@ -128,7 +129,6 @@ private:
      the event, to make it the current task.  */
   ptid_t m_base_ptid = null_ptid;
 
-  void update_inferior_ptid ();
   ptid_t active_task (int cpu);
   bool task_is_currently_active (ptid_t ptid);
   bool runtime_initialized ();
@@ -543,8 +543,9 @@ ravenscar_inferior_created (struct target_ops *target, int from_tty)
       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));
+  rtarget->update_inferior_ptid ();
 }
 
 ptid_t
-- 
2.20.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]