From patchwork Tue Oct 29 17:57:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35413 Received: (qmail 45686 invoked by alias); 29 Oct 2019 17:58:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 44505 invoked by uid 89); 29 Oct 2019 17:58:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=th, suspended X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 29 Oct 2019 17:57:58 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id D436B2104C; Tue, 29 Oct 2019 13:57:56 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 1CEA42104C for ; Tue, 29 Oct 2019 13:57:54 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 0648820AF6 for ; Tue, 29 Oct 2019 13:57:54 -0400 (EDT) X-Gerrit-PatchSet: 1 Date: Tue, 29 Oct 2019 13:57:54 -0400 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Rename windows_thread_info::id to "tid" X-Gerrit-Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f X-Gerrit-Change-Number: 406 X-Gerrit-ChangeURL: X-Gerrit-Commit: 57889f8286603f79cfe0ea14d3b0f39718fe06ad References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-74-g460fb0f7e9 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 * windows-nat.c (struct windows_thread_info) : 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 + * windows-nat.c (struct windows_thread_info) : Rename from "id". + (thread_rec, windows_add_thread, windows_delete_thread) + (windows_continue): Update. + +2019-10-29 Tom Tromey + * 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)