From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from kwanyin.sergiodj.net (kwanyin.sergiodj.net [158.69.185.54]) by sourceware.org (Postfix) with ESMTPS id EC61A3893653 for ; Fri, 24 Apr 2020 19:34:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EC61A3893653 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] Change two windows_thread_info members to "bool" From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: <62fe396b1cba6b0c3d06b758d9f8254c6d538ad8@gdb-build> Date: Fri, 24 Apr 2020 15:34:54 -0400 X-Spam-Status: No, score=-15.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-testers@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-testers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2020 19:34:57 -0000 *** TEST RESULTS FOR COMMIT 62fe396b1cba6b0c3d06b758d9f8254c6d538ad8 *** commit 62fe396b1cba6b0c3d06b758d9f8254c6d538ad8 Author: Tom Tromey AuthorDate: Wed Apr 8 14:33:35 2020 -0600 Commit: Tom Tromey CommitDate: Wed Apr 8 14:47:57 2020 -0600 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 2020-04-08 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. gdbserver/ChangeLog 2020-04-08 Tom Tromey * win32-i386-low.c (update_debug_registers) (i386_prepare_to_resume, i386_thread_added): Update. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f0b1f33485..6fce48c09a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2020-04-08 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. + 2020-04-08 Tom Tromey * windows-nat.c (windows_add_thread): Use new. diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index a3da268642..27fd7ed19d 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -48,7 +48,10 @@ struct windows_thread_info /* 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 @@ -67,11 +70,11 @@ struct windows_thread_info /* 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 715cf602a0..b7f21cb741 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -439,7 +439,7 @@ thread_rec (DWORD id, int get_context) } else if (get_context < 0) th->suspended = -1; - th->reload_context = 1; + th->reload_context = true; } return th; } @@ -695,7 +695,7 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r) dr[7] = th->context.Dr7; } } - th->reload_context = 0; + th->reload_context = false; } if (r < 0) diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog index be2f767662..25b57685d2 100644 --- a/gdbserver/ChangeLog +++ b/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2020-04-08 Tom Tromey + + * win32-i386-low.c (update_debug_registers) + (i386_prepare_to_resume, i386_thread_added): Update. + 2020-04-08 Tom Tromey * win32-low.c (child_add_thread): Use new. diff --git a/gdbserver/win32-i386-low.cc b/gdbserver/win32-i386-low.cc index 29ee49fcd0..1b78cf98b3 100644 --- a/gdbserver/win32-i386-low.cc +++ b/gdbserver/win32-i386-low.cc @@ -44,7 +44,7 @@ update_debug_registers (thread_info *thread) /* 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 @@ i386_prepare_to_resume (windows_thread_info *th) 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