Rename inferior_list_entry uses from "head" to "entry" for consistency.
authorDoug Evans <dje@google.com>
Wed, 19 Feb 2014 22:51:55 +0000 (14:51 -0800)
committerDoug Evans <dje@google.com>
Wed, 19 Feb 2014 22:51:55 +0000 (14:51 -0800)
* dll.h (struct dll_info): Add comment.
* gdbthread.h (struct thread_info): Add comment.
(current_ptid): Simplify.
* inferiors.c (add_process): Update.
(remove_process): Update.
* inferiors.h (struct process_info): Rename member "head" to "entry".
* linux-low.c (delete_lwp): Update.
(add_lwp): Update.
(last_thread_of_process_p): Update.
(kill_one_lwp_callback, linux_kill): Update.
(status_pending_p_callback): Update.
(wait_for_sigstop): Update.  Simplify read of ptid.
(start_step_over): Update.
* linux-low.h (ptid_of, pid_of, lwpid_of): Update.
(get_lwp_thread): Update.
(struct lwp_info): Rename member "head" to "entry".
* regcache.h (inferior_list_entry): Delete.
* server.c (kill_inferior_callback): Update.
(detach_or_kill_inferior_callback): Update.
(print_started_pid): Update.
(print_attached_pid): Update.
(process_serial_event): Simplify read of ptid.
* thread-db.c (thread_db_create_event): Update.
(thread_db_get_tls_address): Update.
* win32-low.c (current_inferior_ptid): Simplify.

gdb/gdbserver/ChangeLog
gdb/gdbserver/dll.h
gdb/gdbserver/gdbthread.h
gdb/gdbserver/inferiors.c
gdb/gdbserver/inferiors.h
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-low.h
gdb/gdbserver/regcache.h
gdb/gdbserver/server.c
gdb/gdbserver/thread-db.c
gdb/gdbserver/win32-low.c

index 9231f07378d489fd1b2064b3ac82c59c2904befb..45ca98dd28d81ed118eab367698d5904437602fe 100644 (file)
@@ -1,3 +1,31 @@
+2014-02-19  Doug Evans  <dje@google.com>
+
+       * dll.h (struct dll_info): Add comment.
+       * gdbthread.h (struct thread_info): Add comment.
+       (current_ptid): Simplify.
+       * inferiors.c (add_process): Update.
+       (remove_process): Update.
+       * inferiors.h (struct process_info): Rename member "head" to "entry".
+       * linux-low.c (delete_lwp): Update.
+       (add_lwp): Update.
+       (last_thread_of_process_p): Update.
+       (kill_one_lwp_callback, linux_kill): Update.
+       (status_pending_p_callback): Update.
+       (wait_for_sigstop): Update.  Simplify read of ptid.
+       (start_step_over): Update.
+       * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
+       (get_lwp_thread): Update.
+       (struct lwp_info): Rename member "head" to "entry".
+       * regcache.h (inferior_list_entry): Delete.
+       * server.c (kill_inferior_callback): Update.
+       (detach_or_kill_inferior_callback): Update.
+       (print_started_pid): Update.
+       (print_attached_pid): Update.
+       (process_serial_event): Simplify read of ptid.
+       * thread-db.c (thread_db_create_event): Update.
+       (thread_db_get_tls_address): Update.
+       * win32-low.c (current_inferior_ptid): Simplify.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target.h (struct target_ops) <supports_btrace>: Add target_ops
index 879f5badc3d5742d3fda29be43c4ea2e7c9c1331..0d26bc6ff83521e837ab757f422c33b45d114d7f 100644 (file)
 
 struct dll_info
 {
+  /* This must appear first.  See inferiors.h.
+     The list iterator functions assume it.  */
   struct inferior_list_entry entry;
+
   char *name;
   CORE_ADDR base_addr;
 };
index a1d9ca8101ce14870de3a300a24c834ba2887680..4c454a2b7bf37593c68056725c4ac7091d13fe88 100644 (file)
@@ -26,7 +26,10 @@ struct btrace_target_info;
 
 struct thread_info
 {
+  /* This must appear first.  See inferiors.h.
+     The list iterator functions assume it.  */
   struct inferior_list_entry entry;
+
   void *target_data;
   void *regcache_data;
 
@@ -76,6 +79,6 @@ void add_thread (ptid_t ptid, void *target_data);
 struct thread_info *find_thread_ptid (ptid_t ptid);
 
 /* Get current thread ID (Linux task ID).  */
-#define current_ptid ((struct inferior_list_entry *) current_inferior)->id
+#define current_ptid (current_inferior->entry.id)
 
 #endif /* GDB_THREAD_H */
index 00339588f8b85a9cf00cf7706442b03863d83164..e3d28eaeb55b0585d8eca020c380ad5ffe330638 100644 (file)
@@ -235,10 +235,10 @@ add_process (int pid, int attached)
 
   process = xcalloc (1, sizeof (*process));
 
-  process->head.id = pid_to_ptid (pid);
+  process->entry.id = pid_to_ptid (pid);
   process->attached = attached;
 
-  add_inferior_to_list (&all_processes, &process->head);
+  add_inferior_to_list (&all_processes, &process->entry);
 
   return process;
 }
@@ -252,7 +252,7 @@ remove_process (struct process_info *process)
 {
   clear_symbol_cache (&process->symbol_cache);
   free_all_breakpoints (process);
-  remove_inferior (&all_processes, &process->head);
+  remove_inferior (&all_processes, &process->entry);
   free (process);
 }
 
index 5f99fbc1f1543cf4e4c4ff825c1f6a2deecdc1e5..f02afddb02f923170c750d02625156efd34729f8 100644 (file)
@@ -42,7 +42,9 @@ struct process_info_private;
 
 struct process_info
 {
-  struct inferior_list_entry head;
+  /* This must appear first.
+     The list iterator functions assume it.  */
+  struct inferior_list_entry entry;
 
   /* Nonzero if this child process was attached rather than
      spawned.  */
@@ -105,6 +107,7 @@ struct inferior_list_entry *find_inferior
       void *arg);
 struct inferior_list_entry *find_inferior_id (struct inferior_list *list,
                                              ptid_t id);
+
 void *inferior_target_data (struct thread_info *);
 void set_inferior_target_data (struct thread_info *, void *);
 void *inferior_regcache_data (struct thread_info *);
index c72d681258ce3298ad210199319f94dc8c3b5d22..011ee58da3ef0c036ff0cdfc243c62f5c8da7747 100644 (file)
@@ -347,7 +347,7 @@ static void
 delete_lwp (struct lwp_info *lwp)
 {
   remove_thread (get_lwp_thread (lwp));
-  remove_inferior (&all_lwps, &lwp->head);
+  remove_inferior (&all_lwps, &lwp->entry);
   free (lwp->arch_private);
   free (lwp);
 }
@@ -533,12 +533,12 @@ add_lwp (ptid_t ptid)
   lwp = (struct lwp_info *) xmalloc (sizeof (*lwp));
   memset (lwp, 0, sizeof (*lwp));
 
-  lwp->head.id = ptid;
+  lwp->entry.id = ptid;
 
   if (the_low_target.new_thread != NULL)
     lwp->arch_private = the_low_target.new_thread ();
 
-  add_inferior_to_list (&all_lwps, &lwp->head);
+  add_inferior_to_list (&all_lwps, &lwp->entry);
 
   return lwp;
 }
@@ -865,7 +865,7 @@ second_thread_of_pid_p (struct inferior_list_entry *entry, void *args)
 static int
 last_thread_of_process_p (struct thread_info *thread)
 {
-  ptid_t ptid = ((struct inferior_list_entry *)thread)->id;
+  ptid_t ptid = thread->entry.id;
   int pid = ptid_get_pid (ptid);
   struct counter counter = { pid , 0 };
 
@@ -941,7 +941,7 @@ kill_one_lwp_callback (struct inferior_list_entry *entry, void *args)
       linux_kill_one_lwp (lwp);
 
       /* Make sure it died.  The loop is most likely unnecessary.  */
-      pid = linux_wait_for_event (lwp->head.id, &wstat, __WALL);
+      pid = linux_wait_for_event (lwp->entry.id, &wstat, __WALL);
     } while (pid > 0 && WIFSTOPPED (wstat));
 
   return 0;
@@ -986,7 +986,7 @@ linux_kill (int pid)
          linux_kill_one_lwp (lwp);
 
          /* Make sure it died.  The loop is most likely unnecessary.  */
-         lwpid = linux_wait_for_event (lwp->head.id, &wstat, __WALL);
+         lwpid = linux_wait_for_event (lwp->entry.id, &wstat, __WALL);
        } while (lwpid > 0 && WIFSTOPPED (wstat));
     }
 
@@ -1223,7 +1223,7 @@ status_pending_p_callback (struct inferior_list_entry *entry, void *arg)
   /* Check if we're only interested in events from a specific process
      or its lwps.  */
   if (!ptid_equal (minus_one_ptid, ptid)
-      && ptid_get_pid (ptid) != ptid_get_pid (lwp->head.id))
+      && ptid_get_pid (ptid) != ptid_get_pid (lwp->entry.id))
     return 0;
 
   thread = get_lwp_thread (lwp);
@@ -2929,11 +2929,11 @@ wait_for_sigstop (struct inferior_list_entry *entry)
 
   saved_inferior = current_inferior;
   if (saved_inferior != NULL)
-    saved_tid = ((struct inferior_list_entry *) saved_inferior)->id;
+    saved_tid = saved_inferior->entry.id;
   else
     saved_tid = null_ptid; /* avoid bogus unused warning */
 
-  ptid = lwp->head.id;
+  ptid = lwp->entry.id;
 
   if (debug_threads)
     debug_printf ("wait_for_sigstop: pulling one event\n");
@@ -3610,7 +3610,7 @@ start_step_over (struct lwp_info *lwp)
   linux_resume_one_lwp (lwp, step, 0, NULL);
 
   /* Require next event from this LWP.  */
-  step_over_bkpt = lwp->head.id;
+  step_over_bkpt = lwp->entry.id;
   return 1;
 }
 
index f2477d9732f520f17a61e12aa0600e35aeef3bc2..3b7ec21d7cedd1121240ae16dfd8cae2fe3711f5 100644 (file)
@@ -223,19 +223,19 @@ struct linux_target_ops
 
 extern struct linux_target_ops the_low_target;
 
-#define ptid_of(proc) ((proc)->head.id)
-#define pid_of(proc) ptid_get_pid ((proc)->head.id)
-#define lwpid_of(proc) ptid_get_lwp ((proc)->head.id)
+#define ptid_of(proc) ((proc)->entry.id)
+#define pid_of(proc) ptid_get_pid ((proc)->entry.id)
+#define lwpid_of(proc) ptid_get_lwp ((proc)->entry.id)
 
 #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)->head.id))
+                                               get_lwp (proc)->entry.id))
 
 struct lwp_info
 {
-  struct inferior_list_entry head;
+  struct inferior_list_entry entry;
 
   /* If this flag is set, the next SIGSTOP will be ignored (the
      process will be immediately resumed).  This means that either we
index 6d18d1edf7bbd9b7f635da7a6ed583efce91894d..891feada43e437edd2e148e345902d6f964429ef 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef REGCACHE_H
 #define REGCACHE_H
 
-struct inferior_list_entry;
 struct thread_info;
 struct target_desc;
 
index a441afd84722721c9cee2083dc7404e24ea644b6..94a72f759954d928e0560aa6bb2c3e2937226940 100644 (file)
@@ -2881,7 +2881,7 @@ static void
 kill_inferior_callback (struct inferior_list_entry *entry)
 {
   struct process_info *process = (struct process_info *) entry;
-  int pid = ptid_get_pid (process->head.id);
+  int pid = ptid_get_pid (process->entry.id);
 
   kill_inferior (pid);
   discard_queued_stop_replies (pid);
@@ -2896,7 +2896,7 @@ static void
 detach_or_kill_inferior_callback (struct inferior_list_entry *entry)
 {
   struct process_info *process = (struct process_info *) entry;
-  int pid = ptid_get_pid (process->head.id);
+  int pid = ptid_get_pid (process->entry.id);
 
   if (process->attached)
     detach_inferior (pid);
@@ -2916,7 +2916,7 @@ print_started_pid (struct inferior_list_entry *entry)
 
   if (! process->attached)
     {
-      int pid = ptid_get_pid (process->head.id);
+      int pid = ptid_get_pid (process->entry.id);
       fprintf (stderr, " %d", pid);
     }
 }
@@ -2931,7 +2931,7 @@ print_attached_pid (struct inferior_list_entry *entry)
 
   if (process->attached)
     {
-      int pid = ptid_get_pid (process->head.id);
+      int pid = ptid_get_pid (process->entry.id);
       fprintf (stderr, " %d", pid);
     }
 }
@@ -3518,7 +3518,7 @@ process_serial_event (void)
                  break;
                }
 
-             thread_id = ((struct inferior_list_entry *)thread)->id;
+             thread_id = thread->entry.id;
            }
          else
            {
index df06b9dbbb9d77afb98eac5cc7e467499248e836..f63e39e8297b7c980b7794dc5c9a907925c20844 100644 (file)
@@ -210,7 +210,7 @@ thread_db_create_event (CORE_ADDR where)
      created threads.  */
   lwp = get_thread_lwp (current_inferior);
   if (lwp->thread_known == 0)
-    find_one_thread (lwp->head.id);
+    find_one_thread (current_inferior->entry.id);
 
   /* msg.event == TD_EVENT_CREATE */
 
@@ -502,7 +502,7 @@ thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset,
 
   lwp = get_thread_lwp (thread);
   if (!lwp->thread_known)
-    find_one_thread (lwp->head.id);
+    find_one_thread (thread->entry.id);
   if (!lwp->thread_known)
     return TD_NOTHR;
 
index 92b001f6c2a61127592d8fa7ded83f3bf4ee0d39..f2620a50773991e4481ad9a78ce7f97cb5b68722 100644 (file)
@@ -114,7 +114,7 @@ static void win32_ensure_ntdll_loaded (void);
 static ptid_t
 current_inferior_ptid (void)
 {
-  return ((struct inferior_list_entry*) current_inferior)->id;
+  return current_ptid;
 }
 
 /* The current debug event from WaitForDebugEvent.  */
This page took 0.043059 seconds and 4 git commands to generate.