]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbserver: remove current_ptid macro
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 6 Nov 2024 19:47:41 +0000 (14:47 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 8 Nov 2024 14:16:23 +0000 (09:16 -0500)
I think it just makes things more obscure.  Use `thread_info::id`
directly instead.

Change-Id: I141d5fb08ebf45c13cc32c4bba62773249fcb356
Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
gdbserver/gdbthread.h
gdbserver/linux-low.cc
gdbserver/mem-break.cc
gdbserver/server.cc
gdbserver/thread-db.cc
gdbserver/tracepoint.cc
gdbserver/win32-low.cc

index b45dc36c28540c9ee25757edf1434e0700706d7f..87fa3f6a0b7455690aa8d21662a717796d4737bb 100644 (file)
@@ -136,9 +136,6 @@ thread_info *find_thread_in_random
 thread_info *find_thread_in_random
   (ptid_t ptid, gdb::function_view<bool (thread_info *)> func);
 
-/* Get current thread ID (Linux task ID).  */
-#define current_ptid (current_thread->id)
-
 /* Get the ptid of THREAD.  */
 
 static inline ptid_t
index e364114c7d21ff3bc8792f3eceb7f2721b7a8753..28d07d9da8fe14420e0fbae7f6eaa69a8a3499e9 100644 (file)
@@ -3970,7 +3970,7 @@ linux_process_target::install_software_single_step_breakpoints (lwp_info *lwp)
   std::vector<CORE_ADDR> next_pcs = low_get_next_pcs (regcache);
 
   for (CORE_ADDR pc : next_pcs)
-    set_single_step_breakpoint (pc, current_ptid);
+    set_single_step_breakpoint (pc, current_thread->id);
 }
 
 int
index 1f7af7138cf3792d68d98ff55fbdac48d948ea2c..818f0042e2adbf3e62c092f8e4656ade0f3c258a 100644 (file)
@@ -1402,7 +1402,7 @@ set_single_step_breakpoint (CORE_ADDR stop_at, ptid_t ptid)
 {
   struct single_step_breakpoint *bp;
 
-  gdb_assert (current_ptid.pid () == ptid.pid ());
+  gdb_assert (current_thread->id.pid () == ptid.pid ());
 
   bp = (struct single_step_breakpoint *) set_breakpoint_type_at (single_step_breakpoint,
                                                                stop_at, NULL);
index 138a8acc953bd4aad8452183f77b79eb5abb02d9..0d7b1edba3ad6473f2ccb85f96a5f4d9c0ec1265 100644 (file)
@@ -3648,7 +3648,7 @@ myresume (char *own_buf, int step, int sig)
 
   if (step || sig || valid_cont_thread)
     {
-      resume_info[0].thread = current_ptid;
+      resume_info[0].thread = current_thread->id;
       if (step)
        resume_info[0].kind = resume_step;
       else
index 96a9ced19ecbb5cb0debdbe7fd756543882bc373..0c014835472d275c90cbe31602c5b6d9aa707892 100644 (file)
@@ -309,7 +309,7 @@ static void
 thread_db_find_new_threads (void)
 {
   td_err_e err;
-  ptid_t ptid = current_ptid;
+  ptid_t ptid = current_thread->id;
   struct thread_db *thread_db = current_process ()->priv->thread_db;
   int loop, iteration;
 
index b7d0ef2c2932c1a0a8ece93e3ceaa40688362193..f7b0a3ee1c13e795f2917877f0449bf23666d5f4 100644 (file)
@@ -6804,7 +6804,7 @@ static int
 run_inferior_command (char *cmd, int len)
 {
   int err = -1;
-  int pid = current_ptid.pid ();
+  int pid = current_thread->id.pid ();
 
   trace_debug ("run_inferior_command: running: %s", cmd);
 
index 18bdc12f6b591db6cd88eb7fd8de9a9428d62f6d..5ef92a100897a5e20691406c2a2d7f0b733388d1 100644 (file)
@@ -74,7 +74,7 @@ const struct target_desc *wow64_win32_tdesc;
 static ptid_t
 current_thread_ptid (void)
 {
-  return current_ptid;
+  return current_thread->id;
 }
 
 /* The current debug event from WaitForDebugEvent.  */