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: 36214 Received: (qmail 93649 invoked by alias); 26 Nov 2019 17:11:53 -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 93615 invoked by uid 89); 26 Nov 2019 17:11:53 -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:51 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id C4AB22064A; Tue, 26 Nov 2019 12:11:47 -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 369B0206E6; Tue, 26 Nov 2019 12:11:31 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 1405820AF6; Tue, 26 Nov 2019 12:11:31 -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] Change two windows_thread_info members to "bool" X-Gerrit-Change-Id: I76e2a3a11543fde4fbd24491d96c2087de1b98b7 X-Gerrit-Change-Number: 409 X-Gerrit-ChangeURL: X-Gerrit-Commit: 51931a8838839eb691b15c3831eaba35d825cdb6 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: <20191126171131.1405820AF6@gnutoolchain-gerrit.osci.io> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/409 ...................................................................... Change two windows_thread_info members to "bool" This changes a couple of fields of windows_thread_info to have type "bool". It also updates the comment of another field, to clarify the possible values it can hold. gdb/ChangeLog 2019-11-26 Tom Tromey * windows-nat.c (thread_rec) (windows_nat_target::fetch_registers): Update. * nat/windows-nat.h (struct windows_thread_info) : Update comment. : Now bool. gdb/gdbserver/ChangeLog 2019-11-26 Tom Tromey * win32-i386-low.c (update_debug_registers) (i386_prepare_to_resume, i386_thread_added): Update. Change-Id: I76e2a3a11543fde4fbd24491d96c2087de1b98b7 --- M gdb/ChangeLog M gdb/gdbserver/ChangeLog M gdb/gdbserver/win32-i386-low.c M gdb/nat/windows-nat.h M gdb/windows-nat.c 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 07b5cee..e48f650 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2019-11-26 Tom Tromey + * windows-nat.c (thread_rec) + (windows_nat_target::fetch_registers): Update. + * nat/windows-nat.h (struct windows_thread_info) : + Update comment. + : Now bool. + +2019-11-26 Tom Tromey + * windows-nat.c (windows_add_thread): Use new. (windows_init_thread_list, windows_delete_thread): Use delete. (get_windows_debug_event): Update. diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index e376af3..2ebf068 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,10 @@ 2019-11-26 Tom Tromey + * win32-i386-low.c (update_debug_registers) + (i386_prepare_to_resume, i386_thread_added): Update. + +2019-11-26 Tom Tromey + * win32-low.c (child_add_thread): Use new. (delete_thread_info): Use delete. diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c index 3fc0cf1..b834b16 100644 --- a/gdb/gdbserver/win32-i386-low.c +++ b/gdb/gdbserver/win32-i386-low.c @@ -44,7 +44,7 @@ /* The actual update is done later just before resuming the lwp, we just mark that the registers need updating. */ - th->debug_registers_changed = 1; + th->debug_registers_changed = true; } /* Update the inferior's debug register REGNUM from STATE. */ @@ -253,14 +253,14 @@ FIXME: should we set dr6 also ?? */ th->context.Dr7 = dr->dr_control_mirror; - th->debug_registers_changed = 0; + th->debug_registers_changed = false; } } static void i386_thread_added (windows_thread_info *th) { - th->debug_registers_changed = 1; + th->debug_registers_changed = true; } static void diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 2fe2a2f..e5d7e63 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -46,7 +46,10 @@ /* Thread Information Block address. */ CORE_ADDR thread_local_base; - /* Non zero if SuspendThread was called on this thread. */ + /* This keeps track of whether SuspendThread was called on this + thread. -1 means there was a failure or that the thread was + explicitly not suspended, 1 means it was called, and 0 means it + was not. */ int suspended = 0; #ifdef _WIN32_WCE @@ -59,11 +62,11 @@ /* Whether debug registers changed since we last set CONTEXT back to the thread. */ - int debug_registers_changed = 0; + bool debug_registers_changed = false; /* Nonzero if CONTEXT is invalidated and must be re-read from the inferior thread. */ - int reload_context = 0; + bool reload_context = false; /* The name of the thread, allocated by xmalloc. */ char *name = nullptr; diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 31039d5..4898fba 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -400,7 +400,7 @@ } else if (get_context < 0) th->suspended = -1; - th->reload_context = 1; + th->reload_context = true; } return th; } @@ -604,7 +604,7 @@ dr[7] = th->context.Dr7; } } - th->reload_context = 0; + th->reload_context = false; } if (r < 0)