From patchwork Wed Jun 3 17:29:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Turney X-Patchwork-Id: 7032 Received: (qmail 73083 invoked by alias); 3 Jun 2015 17:30:48 -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 72975 invoked by uid 89); 3 Jun 2015 17:30:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 X-HELO: rgout0501.bt.lon5.cpcloud.co.uk Received: from rgout0501.bt.lon5.cpcloud.co.uk (HELO rgout0501.bt.lon5.cpcloud.co.uk) (65.20.0.222) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Jun 2015 17:30:45 +0000 X-OWM-Source-IP: 31.51.205.195(GB) X-OWM-Env-Sender: jonturney@btinternet.com X-CTCH-RefID: str=0001.0A090203.556F39C4.008E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-Junkmail-Premium-Raw: score=27/50, refid=2.7.2:2015.6.2.124816:17:27.888, ip=31.51.205.195, rules=__HAS_FROM, __TO_MALFORMED_2, __TO_NO_NAME, __HAS_MSGID, __SANE_MSGID, __HAS_X_MAILER, __IN_REP_TO, __REFERENCES, __ANY_URI, __URI_NO_WWW, __URI_NO_PATH, __CP_NOT_1, BODY_SIZE_3000_3999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, __URI_NS, SXL_IP_DYNAMIC[195.205.51.31.fur], HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, RDNS_SUSP, BODY_SIZE_7000_LESS, REFERENCES X-CTCH-Spam: Unknown Received: from localhost.localdomain (31.51.205.195) by rgout05.bt.lon5.cpcloud.co.uk (8.6.122.06) (authenticated as jonturney@btinternet.com) id 556DA854008F2971; Wed, 3 Jun 2015 18:30:36 +0100 From: Jon Turney To: gdb-patches@sourceware.org Cc: Jon Turney Subject: [PATCH 3/4] windows-nat: Consistently use numeric get_context parameter to thread_rec() Date: Wed, 3 Jun 2015 18:29:51 +0100 Message-Id: <1433352592-9728-5-git-send-email-jon.turney@dronecode.org.uk> In-Reply-To: <1433352592-9728-1-git-send-email-jon.turney@dronecode.org.uk> References: <1433352592-9728-1-git-send-email-jon.turney@dronecode.org.uk> thread_rec()'s get_context parameter is not a bool, and has the following meanings >0 suspend, retrieve context 0 use already retrieved context <0 already suspended, retrieve context Consistently use numeric values throughout windows-nat.c, rather than a mixture of numeric and bool values. gdb/ChangeLog: 2015-06-03 Jon Turney * windows-nat.c : Consistently use numeric get_context parameter to thread_rec() throughout. Signed-off-by: Jon Turney --- gdb/ChangeLog | 5 +++++ gdb/windows-nat.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d170f7c..996dffe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2015-06-03 Jon Turney + * windows-nat.c : Consistently use numeric get_context parameter + to thread_rec() throughout. + +2015-06-03 Jon Turney + * windows-nat.c (do_windows_fetch_inferior_registers) (handle_output_debug_string): Replace __COPY_CONTEXT_SIZE conditional with __CYGWIN__. diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 9d2e3c2..ce1513f 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -341,7 +341,7 @@ windows_add_thread (ptid_t ptid, HANDLE h, void *tlb) id = ptid_get_tid (ptid); - if ((th = thread_rec (id, FALSE))) + if ((th = thread_rec (id, 0))) return th; th = XCNEW (windows_thread_info); @@ -496,7 +496,7 @@ static void windows_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int r) { - current_thread = thread_rec (ptid_get_tid (inferior_ptid), TRUE); + current_thread = thread_rec (ptid_get_tid (inferior_ptid), 1); /* Check if current_thread exists. Windows sometimes uses a non-existent thread id in its events. */ if (current_thread) @@ -523,7 +523,7 @@ static void windows_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int r) { - current_thread = thread_rec (ptid_get_tid (inferior_ptid), TRUE); + current_thread = thread_rec (ptid_get_tid (inferior_ptid), 1); /* Check if current_thread exists. Windows sometimes uses a non-existent thread id in its events. */ if (current_thread) @@ -1252,7 +1252,7 @@ windows_resume (struct target_ops *ops, ptid_get_pid (ptid), ptid_get_tid (ptid), step, sig)); /* Get context for currently selected thread. */ - th = thread_rec (ptid_get_tid (inferior_ptid), FALSE); + th = thread_rec (ptid_get_tid (inferior_ptid), 0); if (th) { if (step) @@ -1513,7 +1513,7 @@ get_windows_debug_event (struct target_ops *ops, thread_id); current_thread = th; if (!current_thread) - current_thread = thread_rec (thread_id, TRUE); + current_thread = thread_rec (thread_id, 1); } out: @@ -2667,7 +2667,7 @@ windows_thread_alive (struct target_ops *ops, ptid_t ptid) gdb_assert (ptid_get_tid (ptid) != 0); tid = ptid_get_tid (ptid); - return WaitForSingleObject (thread_rec (tid, FALSE)->h, 0) == WAIT_OBJECT_0 + return WaitForSingleObject (thread_rec (tid, 0)->h, 0) == WAIT_OBJECT_0 ? FALSE : TRUE; }