From patchwork Tue Nov 26 17:11:28 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: 36210 Received: (qmail 92160 invoked by alias); 26 Nov 2019 17:11:44 -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 92098 invoked by uid 89); 26 Nov 2019 17:11:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= 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, 26 Nov 2019 17:11:42 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 6433B2068F; Tue, 26 Nov 2019 12:11:38 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id E8F6B20387; Tue, 26 Nov 2019 12:11:30 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id BFEED20AF6; Tue, 26 Nov 2019 12:11:30 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Tue, 26 Nov 2019 12:11:28 -0500 From: "Tom Tromey (Code Review)" To: Luis Machado , Simon Marchi , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v2] Rename windows_thread_info::id to "tid" X-Gerrit-Change-Id: Ia4b72201c53716b15a7a6753982988c35ced137f X-Gerrit-Change-Number: 406 X-Gerrit-ChangeURL: X-Gerrit-Commit: 05b4e34c3f0db75f4b9ce61ea2f37b270a62bbf6 In-Reply-To: References: Reply-To: tromey@sourceware.org, simon.marchi@polymtl.ca, luis.machado@linaro.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20191126171130.BFEED20AF6@gnutoolchain-gerrit.osci.io> 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 * 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 a081fce..5eb664f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2019-11-26 Tom Tromey + * windows-nat.c (struct windows_thread_info) : Rename from "id". + (thread_rec, windows_add_thread, windows_delete_thread) + (windows_continue): Update. + +2019-11-26 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 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)