public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [review] Rename windows_thread_info::id to "tid"
@ 2019-10-29 17:58 Tom Tromey (Code Review)
  2019-10-31  3:42 ` Luis Machado (Code Review)
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tom Tromey (Code Review) @ 2019-10-29 17:58 UTC (permalink / raw)
  To: gdb-patches

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/406
......................................................................

Rename windows_thread_info::id to "tid"

This changes the name of a field in windows_thread_info, bringing gdb
and gdbserver closer into sync.

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

	* windows-nat.c (struct windows_thread_info) <tid>: Rename from "id".
	(thread_rec, windows_add_thread, windows_delete_thread)
	(windows_continue): Update.

Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f
---
M gdb/ChangeLog
M gdb/windows-nat.c
2 files changed, 11 insertions(+), 5 deletions(-)



diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d255440..be5ea7b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2019-10-29  Tom Tromey  <tromey@adacore.com>
 
+	* windows-nat.c (struct windows_thread_info) <tid>: Rename from "id".
+	(thread_rec, windows_add_thread, windows_delete_thread)
+	(windows_continue): Update.
+
+2019-10-29  Tom Tromey  <tromey@adacore.com>
+
 	* windows-nat.c (struct windows_thread_info): Remove typedef.
 	(thread_head): Remove.
 	(thread_list): New global.
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 3bd8c0f..60b9cb5 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -217,7 +217,7 @@
    not available in gdb's thread structure.  */
 struct windows_thread_info
   {
-    DWORD id;
+    DWORD tid;
     HANDLE h;
     CORE_ADDR thread_local_base;
     char *name;
@@ -384,7 +384,7 @@
 thread_rec (DWORD id, int get_context)
 {
   for (windows_thread_info *th : thread_list)
-    if (th->id == id)
+    if (th->tid == id)
       {
 	if (!th->suspended && get_context)
 	  {
@@ -442,7 +442,7 @@
     return th;
 
   th = XCNEW (windows_thread_info);
-  th->id = id;
+  th->tid = id;
   th->h = h;
   th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb;
   thread_list.push_back (th);
@@ -524,7 +524,7 @@
   auto iter = std::find_if (thread_list.begin (), thread_list.end (),
 			    [=] (windows_thread_info *th)
 			    {
-			      return th->id == id;
+			      return th->tid == id;
 			    });
 
   if (iter != thread_list.end ())
@@ -1319,7 +1319,7 @@
 		  "DBG_CONTINUE" : "DBG_EXCEPTION_NOT_HANDLED"));
 
   for (windows_thread_info *th : thread_list)
-    if ((id == -1 || id == (int) th->id)
+    if ((id == -1 || id == (int) th->tid)
 	&& th->suspended)
       {
 	if (debug_registers_changed)

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f
Gerrit-Change-Number: 406
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: newchange

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review] Rename windows_thread_info::id to "tid"
  2019-10-29 17:58 [review] Rename windows_thread_info::id to "tid" Tom Tromey (Code Review)
@ 2019-10-31  3:42 ` Luis Machado (Code Review)
  2019-10-31 14:22 ` Simon Marchi (Code Review)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Luis Machado (Code Review) @ 2019-10-31  3:42 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

Luis Machado has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/406
......................................................................


Patch Set 1: Code-Review+1

Looks sane.


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f
Gerrit-Change-Number: 406
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Comment-Date: Thu, 31 Oct 2019 03:42:17 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review] Rename windows_thread_info::id to "tid"
  2019-10-29 17:58 [review] Rename windows_thread_info::id to "tid" Tom Tromey (Code Review)
  2019-10-31  3:42 ` Luis Machado (Code Review)
@ 2019-10-31 14:22 ` Simon Marchi (Code Review)
  2019-11-26 17:11 ` [review v2] " Tom Tromey (Code Review)
  2019-11-29 17:50 ` Pedro Alves (Code Review)
  3 siblings, 0 replies; 5+ messages in thread
From: Simon Marchi (Code Review) @ 2019-10-31 14:22 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches; +Cc: Luis Machado

Simon Marchi has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/406
......................................................................


Patch Set 1: Code-Review+2


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f
Gerrit-Change-Number: 406
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Thu, 31 Oct 2019 14:22:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review v2] Rename windows_thread_info::id to "tid"
  2019-10-29 17:58 [review] Rename windows_thread_info::id to "tid" Tom Tromey (Code Review)
  2019-10-31  3:42 ` Luis Machado (Code Review)
  2019-10-31 14:22 ` Simon Marchi (Code Review)
@ 2019-11-26 17:11 ` Tom Tromey (Code Review)
  2019-11-29 17:50 ` Pedro Alves (Code Review)
  3 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey (Code Review) @ 2019-11-26 17:11 UTC (permalink / raw)
  To: Luis Machado, Simon Marchi, gdb-patches

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/406
......................................................................

Rename windows_thread_info::id to "tid"

This changes the name of a field in windows_thread_info, bringing gdb
and gdbserver closer into sync.

gdb/ChangeLog
2019-11-26  Tom Tromey  <tromey@adacore.com>

	* windows-nat.c (struct windows_thread_info) <tid>: Rename from "id".
	(thread_rec, windows_add_thread, windows_delete_thread)
	(windows_continue): Update.

Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f
---
M gdb/ChangeLog
M gdb/windows-nat.c
2 files changed, 11 insertions(+), 5 deletions(-)



diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a081fce..5eb664f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2019-11-26  Tom Tromey  <tromey@adacore.com>
 
+	* windows-nat.c (struct windows_thread_info) <tid>: Rename from "id".
+	(thread_rec, windows_add_thread, windows_delete_thread)
+	(windows_continue): Update.
+
+2019-11-26  Tom Tromey  <tromey@adacore.com>
+
 	* windows-nat.c (struct windows_thread_info): Remove typedef.
 	(thread_head): Remove.
 	(thread_list): New global.
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 88e04e7..06514d0 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -217,7 +217,7 @@
    not available in gdb's thread structure.  */
 struct windows_thread_info
   {
-    DWORD id;
+    DWORD tid;
     HANDLE h;
     CORE_ADDR thread_local_base;
     char *name;
@@ -384,7 +384,7 @@
 thread_rec (DWORD id, int get_context)
 {
   for (windows_thread_info *th : thread_list)
-    if (th->id == id)
+    if (th->tid == id)
       {
 	if (!th->suspended && get_context)
 	  {
@@ -442,7 +442,7 @@
     return th;
 
   th = XCNEW (windows_thread_info);
-  th->id = id;
+  th->tid = id;
   th->h = h;
   th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb;
   thread_list.push_back (th);
@@ -524,7 +524,7 @@
   auto iter = std::find_if (thread_list.begin (), thread_list.end (),
 			    [=] (windows_thread_info *th)
 			    {
-			      return th->id == id;
+			      return th->tid == id;
 			    });
 
   if (iter != thread_list.end ())
@@ -1319,7 +1319,7 @@
 		  "DBG_CONTINUE" : "DBG_EXCEPTION_NOT_HANDLED"));
 
   for (windows_thread_info *th : thread_list)
-    if ((id == -1 || id == (int) th->id)
+    if ((id == -1 || id == (int) th->tid)
 	&& th->suspended)
       {
 	if (debug_registers_changed)

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f
Gerrit-Change-Number: 406
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-MessageType: newpatchset

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review v2] Rename windows_thread_info::id to "tid"
  2019-10-29 17:58 [review] Rename windows_thread_info::id to "tid" Tom Tromey (Code Review)
                   ` (2 preceding siblings ...)
  2019-11-26 17:11 ` [review v2] " Tom Tromey (Code Review)
@ 2019-11-29 17:50 ` Pedro Alves (Code Review)
  3 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves (Code Review) @ 2019-11-29 17:50 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches; +Cc: Simon Marchi, Luis Machado

Pedro Alves has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/406
......................................................................


Patch Set 2: Code-Review+2


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f
Gerrit-Change-Number: 406
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Pedro Alves <palves@redhat.com>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Fri, 29 Nov 2019 17:50:39 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-29 17:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29 17:58 [review] Rename windows_thread_info::id to "tid" Tom Tromey (Code Review)
2019-10-31  3:42 ` Luis Machado (Code Review)
2019-10-31 14:22 ` Simon Marchi (Code Review)
2019-11-26 17:11 ` [review v2] " Tom Tromey (Code Review)
2019-11-29 17:50 ` Pedro Alves (Code Review)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).