]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbserver: Rename some functions, thread -> inferior
authorSimon Marchi <simon.marchi@ericsson.com>
Fri, 25 Aug 2017 08:45:33 +0000 (10:45 +0200)
committerSimon Marchi <simon.marchi@ericsson.com>
Fri, 25 Aug 2017 08:45:33 +0000 (10:45 +0200)
These functions apply to thread, and not inferiors (in the gdbserver
sense, the abstraction for threads and processes, as in
inferior_list).  Therefore, it would make more sense if these functions
were named with "thread" rather than "inferior".

gdb/gdbserver/ChangeLog:

* inferiors.h (inferior_target_data): Rename to ...
(thread_target_data): ... this.
(inferior_regcache_data): Rename to ...
(thread_regcache_data): ... this.
(set_inferior_regcache_data): Rename to ...
(set_thread_regcache_data): ... this.
* inferiors.c (inferior_target_data): Rename to ...
(thread_target_data): ... this.
(inferior_regcache_data): Rename to ...
(thread_regcache_data): ... this.
(set_inferior_regcache_data): Rename to ...
(set_thread_regcache_data): ... this.
(free_one_thread): Update.
* linux-low.h (get_thread_lwp): Update.
* regcache.c (get_thread_regcache): Update.
(regcache_invalidate_thread): Update.
(free_register_cache_thread): Update.
* win32-i386-low.c (update_debug_registers_callback): Update.
(win32_get_current_dr): Update.
* win32-low.c (thread_rec): Update.
(delete_thread_info): Update.
(continue_one_thread): Update.
(suspend_one_thread): Update.

gdb/gdbserver/ChangeLog
gdb/gdbserver/inferiors.c
gdb/gdbserver/inferiors.h
gdb/gdbserver/linux-low.h
gdb/gdbserver/regcache.c
gdb/gdbserver/win32-i386-low.c
gdb/gdbserver/win32-low.c

index 0bf961053bffb8bdb80f4906ae5ae035ecde62ae..117ba5f6feb037098285898d24ed64dfdd3e69d3 100644 (file)
@@ -1,3 +1,29 @@
+2017-08-25  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * inferiors.h (inferior_target_data): Rename to ...
+       (thread_target_data): ... this.
+       (inferior_regcache_data): Rename to ...
+       (thread_regcache_data): ... this.
+       (set_inferior_regcache_data): Rename to ...
+       (set_thread_regcache_data): ... this.
+       * inferiors.c (inferior_target_data): Rename to ...
+       (thread_target_data): ... this.
+       (inferior_regcache_data): Rename to ...
+       (thread_regcache_data): ... this.
+       (set_inferior_regcache_data): Rename to ...
+       (set_thread_regcache_data): ... this.
+       (free_one_thread): Update.
+       * linux-low.h (get_thread_lwp): Update.
+       * regcache.c (get_thread_regcache): Update.
+       (regcache_invalidate_thread): Update.
+       (free_register_cache_thread): Update.
+       * win32-i386-low.c (update_debug_registers_callback): Update.
+       (win32_get_current_dr): Update.
+       * win32-low.c (thread_rec): Update.
+       (delete_thread_info): Update.
+       (continue_one_thread): Update.
+       (suspend_one_thread): Update.
+
 2017-08-24  Simon Marchi  <simon.marchi@ericsson.com>
 
        * inferiors.c (set_inferior_target_data): Remove.
index 8a2e5d2ab1984f832d3e14034653f680342b78c4..3c171a179ec66a1eb0003aafefc8a3e454410a66 100644 (file)
@@ -197,7 +197,7 @@ static void
 free_one_thread (struct inferior_list_entry *inf)
 {
   struct thread_info *thread = get_thread (inf);
-  free_register_cache (inferior_regcache_data (thread));
+  free_register_cache (thread_regcache_data (thread));
   free (thread);
 }
 
@@ -309,21 +309,21 @@ find_inferior_id (struct inferior_list *list, ptid_t id)
 }
 
 void *
-inferior_target_data (struct thread_info *inferior)
+thread_target_data (struct thread_info *thread)
 {
-  return inferior->target_data;
+  return thread->target_data;
 }
 
 struct regcache *
-inferior_regcache_data (struct thread_info *inferior)
+thread_regcache_data (struct thread_info *thread)
 {
-  return inferior->regcache_data;
+  return thread->regcache_data;
 }
 
 void
-set_inferior_regcache_data (struct thread_info *inferior, struct regcache *data)
+set_thread_regcache_data (struct thread_info *thread, struct regcache *data)
 {
-  inferior->regcache_data = data;
+  thread->regcache_data = data;
 }
 
 /* Return true if LIST has exactly one entry.  */
index be248b077742bf7d77c855fe00f4669cbadc20e9..f229e67336727639d1a1e1cc6d16ac25072e4898 100644 (file)
@@ -160,8 +160,8 @@ struct inferior_list_entry *
                                        void *),
                           void *arg);
 
-void *inferior_target_data (struct thread_info *);
-struct regcache *inferior_regcache_data (struct thread_info *);
-void set_inferior_regcache_data (struct thread_info *, struct regcache *);
+void *thread_target_data (struct thread_info *);
+struct regcache *thread_regcache_data (struct thread_info *);
+void set_thread_regcache_data (struct thread_info *, struct regcache *);
 
 #endif /* INFERIORS_H */
index 2bf7e7cd782d8f82694e58b307e50ef774dbc424..91061447cc6c055f2e86f9b5baed7bedac758e05 100644 (file)
@@ -252,7 +252,7 @@ struct linux_target_ops
 
 extern struct linux_target_ops the_low_target;
 
-#define get_thread_lwp(thr) ((struct lwp_info *) (inferior_target_data (thr)))
+#define get_thread_lwp(thr) ((struct lwp_info *) (thread_target_data (thr)))
 #define get_lwp_thread(lwp) ((lwp)->thread)
 
 /* This struct is recorded in the target_data field of struct thread_info.
index 0f16f60e0ffce61bad5a165d0a21e9e7684f9404..9b837e75a3e38ee86e46414055ee7a56a901cb75 100644 (file)
@@ -28,7 +28,7 @@ get_thread_regcache (struct thread_info *thread, int fetch)
 {
   struct regcache *regcache;
 
-  regcache = inferior_regcache_data (thread);
+  regcache = thread_regcache_data (thread);
 
   /* Threads' regcaches are created lazily, because biarch targets add
      the main thread/lwp before seeing it stop for the first time, and
@@ -44,7 +44,7 @@ get_thread_regcache (struct thread_info *thread, int fetch)
       gdb_assert (proc->tdesc != NULL);
 
       regcache = new_register_cache (proc->tdesc);
-      set_inferior_regcache_data (thread, regcache);
+      set_thread_regcache_data (thread, regcache);
     }
 
   if (fetch && regcache->registers_valid == 0)
@@ -76,7 +76,7 @@ regcache_invalidate_thread (struct thread_info *thread)
 {
   struct regcache *regcache;
 
-  regcache = inferior_regcache_data (thread);
+  regcache = thread_regcache_data (thread);
 
   if (regcache == NULL)
     return;
@@ -277,13 +277,13 @@ find_register_by_number (const struct target_desc *tdesc, int n)
 static void
 free_register_cache_thread (struct thread_info *thread)
 {
-  struct regcache *regcache = inferior_regcache_data (thread);
+  struct regcache *regcache = thread_regcache_data (thread);
 
   if (regcache != NULL)
     {
       regcache_invalidate_thread (thread);
       free_register_cache (regcache);
-      set_inferior_regcache_data (thread, NULL);
+      set_thread_regcache_data (thread, NULL);
     }
 }
 
index c505190d44c3f320733c96b80f9c473fb6531ec0..40bdf12d4a38d96ea5602f360fdd0019b7fc1003 100644 (file)
@@ -45,7 +45,7 @@ update_debug_registers_callback (struct inferior_list_entry *entry,
                                 void *pid_p)
 {
   struct thread_info *thr = (struct thread_info *) entry;
-  win32_thread_info *th = (win32_thread_info *) inferior_target_data (thr);
+  win32_thread_info *th = (win32_thread_info *) thread_target_data (thr);
   int pid = *(int *) pid_p;
 
   /* Only update the threads of this process.  */
@@ -90,7 +90,7 @@ static DWORD64
 win32_get_current_dr (int dr)
 {
   win32_thread_info *th
-    = (win32_thread_info *) inferior_target_data (current_thread);
+    = (win32_thread_info *) thread_target_data (current_thread);
 
   win32_require_context (th);
 
index 88f6911b010637c97562fa21dc8f55fabe57658d..cc84d15c2f5af5dd3d529b3ad21668fb7a0ff42f 100644 (file)
@@ -198,7 +198,7 @@ thread_rec (ptid_t ptid, int get_context)
   if (thread == NULL)
     return NULL;
 
-  th = (win32_thread_info *) inferior_target_data (thread);
+  th = (win32_thread_info *) thread_target_data (thread);
   if (get_context)
     win32_require_context (th);
   return th;
@@ -232,7 +232,7 @@ static void
 delete_thread_info (struct inferior_list_entry *entry)
 {
   struct thread_info *thread = (struct thread_info *) entry;
-  win32_thread_info *th = (win32_thread_info *) inferior_target_data (thread);
+  win32_thread_info *th = (win32_thread_info *) thread_target_data (thread);
 
   remove_thread (thread);
   CloseHandle (th->h);
@@ -433,7 +433,7 @@ continue_one_thread (struct inferior_list_entry *this_thread, void *id_ptr)
 {
   struct thread_info *thread = (struct thread_info *) this_thread;
   int thread_id = * (int *) id_ptr;
-  win32_thread_info *th = (win32_thread_info *) inferior_target_data (thread);
+  win32_thread_info *th = (win32_thread_info *) thread_target_data (thread);
 
   if (thread_id == -1 || thread_id == th->tid)
     {
@@ -1333,7 +1333,7 @@ static void
 suspend_one_thread (struct inferior_list_entry *entry)
 {
   struct thread_info *thread = (struct thread_info *) entry;
-  win32_thread_info *th = (win32_thread_info *) inferior_target_data (thread);
+  win32_thread_info *th = (win32_thread_info *) thread_target_data (thread);
 
   if (!th->suspended)
     {