[1/2] Rename pid -> tid in windows-nat.c

Message ID 20191014145744.5535-2-tromey@adacore.com
State New
Headers show
Series
  • minor windows-nat changes
Related show

Commit Message

Tom Tromey Oct. 14, 2019, 2:57 p.m.
A couple of spots in windows-nat.c used the name "pid" to refer to the
thread ID.  I found this confusing, so this patch changes the names.

gdb/ChangeLog
2019-10-14  Tom Tromey  <tromey@adacore.com>

	* windows-nat.c (windows_nat_target::fetch_registers)
	(windows_nat_target::store_registers): Rename "pid" to "tid".
---
 gdb/ChangeLog     | 5 +++++
 gdb/windows-nat.c | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

-- 
2.20.1

Comments

Joel Brobecker Oct. 15, 2019, 3:55 p.m. | #1
> A couple of spots in windows-nat.c used the name "pid" to refer to the

> thread ID.  I found this confusing, so this patch changes the names.

> 

> gdb/ChangeLog

> 2019-10-14  Tom Tromey  <tromey@adacore.com>

> 

> 	* windows-nat.c (windows_nat_target::fetch_registers)

> 	(windows_nat_target::store_registers): Rename "pid" to "tid".


I've reviewed this internally at AdaCore, and this seems sufficiently
straightforward that I'll approve again here. Go ahead, Tom.

> ---

>  gdb/ChangeLog     | 5 +++++

>  gdb/windows-nat.c | 8 ++++----

>  2 files changed, 9 insertions(+), 4 deletions(-)

> 

> diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c

> index 607b2e8cb97..df44994c95a 100644

> --- a/gdb/windows-nat.c

> +++ b/gdb/windows-nat.c

> @@ -590,8 +590,8 @@ windows_fetch_one_register (struct regcache *regcache,

>  void

>  windows_nat_target::fetch_registers (struct regcache *regcache, int r)

>  {

> -  DWORD pid = regcache->ptid ().tid ();

> -  windows_thread_info *th = thread_rec (pid, TRUE);

> +  DWORD tid = regcache->ptid ().tid ();

> +  windows_thread_info *th = thread_rec (tid, TRUE);

>  

>    /* Check if TH exists.  Windows sometimes uses a non-existent

>       thread id in its events.  */

> @@ -660,8 +660,8 @@ windows_store_one_register (const struct regcache *regcache,

>  void

>  windows_nat_target::store_registers (struct regcache *regcache, int r)

>  {

> -  DWORD pid = regcache->ptid ().tid ();

> -  windows_thread_info *th = thread_rec (pid, TRUE);

> +  DWORD tid = regcache->ptid ().tid ();

> +  windows_thread_info *th = thread_rec (tid, TRUE);

>  

>    /* Check if TH exists.  Windows sometimes uses a non-existent

>       thread id in its events.  */

> -- 

> 2.20.1


-- 
Joel

Patch

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 607b2e8cb97..df44994c95a 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -590,8 +590,8 @@  windows_fetch_one_register (struct regcache *regcache,
 void
 windows_nat_target::fetch_registers (struct regcache *regcache, int r)
 {
-  DWORD pid = regcache->ptid ().tid ();
-  windows_thread_info *th = thread_rec (pid, TRUE);
+  DWORD tid = regcache->ptid ().tid ();
+  windows_thread_info *th = thread_rec (tid, TRUE);
 
   /* Check if TH exists.  Windows sometimes uses a non-existent
      thread id in its events.  */
@@ -660,8 +660,8 @@  windows_store_one_register (const struct regcache *regcache,
 void
 windows_nat_target::store_registers (struct regcache *regcache, int r)
 {
-  DWORD pid = regcache->ptid ().tid ();
-  windows_thread_info *th = thread_rec (pid, TRUE);
+  DWORD tid = regcache->ptid ().tid ();
+  windows_thread_info *th = thread_rec (tid, TRUE);
 
   /* Check if TH exists.  Windows sometimes uses a non-existent
      thread id in its events.  */