Add backlink from lwp_info to thread_info.
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-low.h
index 3b7ec21d7cedd1121240ae16dfd8cae2fe3711f5..b3e75dbd7ce14000c3ddcb26df44c5c1be7c8594 100644 (file)
@@ -229,14 +229,17 @@ extern struct linux_target_ops the_low_target;
 
 #define get_lwp(inf) ((struct lwp_info *)(inf))
 #define get_thread_lwp(thr) (get_lwp (inferior_target_data (thr)))
-#define get_lwp_thread(proc) ((struct thread_info *)                   \
-                             find_inferior_id (&all_threads,           \
-                                               get_lwp (proc)->entry.id))
+#define get_lwp_thread(lwp) ((lwp)->thread)
 
 struct lwp_info
 {
   struct inferior_list_entry entry;
 
+  /* Backlink to the thread_info object.
+     It is the "main" representation of the thread, we just contain
+     linux-specific subordinate data.  */
+  struct thread_info *thread;
+
   /* If this flag is set, the next SIGSTOP will be ignored (the
      process will be immediately resumed).  This means that either we
      sent the SIGSTOP to it ourselves and got some other pending event
This page took 0.024041 seconds and 4 git commands to generate.