From patchwork Tue Nov 26 17:11:33 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: 36237 Received: (qmail 119708 invoked by alias); 26 Nov 2019 17:21:58 -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 119655 invoked by uid 89); 26 Nov 2019 17:21:58 -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:21:56 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id ADB752053D; Tue, 26 Nov 2019 12:12:02 -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 D470222270 for ; Tue, 26 Nov 2019 12:11:33 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 966E028174 for ; Tue, 26 Nov 2019 12:11:33 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Tue, 26 Nov 2019 12:11:33 -0500 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Make last_wait_event static X-Gerrit-Change-Id: I67ea86e1d2ede0b4e0fb96761261ece01ef514b2 X-Gerrit-Change-Number: 720 X-Gerrit-ChangeURL: X-Gerrit-Commit: 0169f5132cc10e67921540de7d89b641b1557b58 References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/720 ...................................................................... Make last_wait_event static Now that last_wait_event is entirely handled in nat/windows-nat.c, it can be made static. 2019-11-26 Tom Tromey * nat/windows-nat.h (last_wait_event): Don't declare. (wait_for_debug_event): Update comment. * nat/windows-nat.c (last_wait_event): Now static. Change-Id: I67ea86e1d2ede0b4e0fb96761261ece01ef514b2 --- M gdb/ChangeLog M gdb/nat/windows-nat.c M gdb/nat/windows-nat.h 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index afe6ae9..f859445 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2019-11-26 Tom Tromey + * nat/windows-nat.h (last_wait_event): Don't declare. + (wait_for_debug_event): Update comment. + * nat/windows-nat.c (last_wait_event): Now static. + +2019-11-26 Tom Tromey + * windows-nat.c (wait_for_debug_event): Move to nat/windows-nat.c. * nat/windows-nat.h (wait_for_debug_event): Declare. diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index 8b00142..8206edd 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -28,7 +28,14 @@ DWORD main_thread_id; enum gdb_signal last_sig = GDB_SIGNAL_0; DEBUG_EVENT current_event; -DEBUG_EVENT last_wait_event; + +/* The most recent event from WaitForDebugEvent. Unlike + current_event, this is guaranteed never to come from a pending + stop. This is important because only data from the most recent + event from WaitForDebugEvent can be used when calling + ContinueDebugEvent. */ +static DEBUG_EVENT last_wait_event; + windows_thread_info *current_windows_thread; DWORD desired_stop_thread_id = -1; std::vector pending_stops; diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index ebdbacd..5c99c43 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -155,13 +155,6 @@ stop. */ extern DEBUG_EVENT current_event; -/* The most recent event from WaitForDebugEvent. Unlike - current_event, this is guaranteed never to come from a pending - stop. This is important because only data from the most recent - event from WaitForDebugEvent can be used when calling - ContinueDebugEvent. */ -extern DEBUG_EVENT last_wait_event; - /* Info on currently selected thread */ extern windows_thread_info *current_windows_thread; @@ -231,7 +224,7 @@ extern BOOL continue_last_debug_event (DWORD continue_status, bool debug_events); -/* A simple wrapper for WaitForDebugEvent that also sets +/* A simple wrapper for WaitForDebugEvent that also sets the internal 'last_wait_event' on success. */ extern BOOL wait_for_debug_event (DEBUG_EVENT *event, DWORD timeout);