[review] Make last_wait_event static

Message ID gerrit.1572371871000.I929d63d03244def0b7fd26d2465a6ef09070cb83@gnutoolchain-gerrit.osci.io
State Superseded
Headers show
Series
  • [review] Make last_wait_event static
Related show

Commit Message

Simon Marchi (Code Review) Oct. 29, 2019, 5:57 p.m.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/429
......................................................................

Make last_wait_event static

Now that last_wait_event is entirely handled in nat/windows-nat.c, it
can be made static.

Change-Id: I67ea86e1d2ede0b4e0fb96761261ece01ef514b2

gdb/ChangeLog
2019-10-29  Tom Tromey  <tromey@adacore.com>

	* 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: I929d63d03244def0b7fd26d2465a6ef09070cb83
---
M gdb/ChangeLog
M gdb/nat/windows-nat.c
M gdb/nat/windows-nat.h
3 files changed, 15 insertions(+), 9 deletions(-)




-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I929d63d03244def0b7fd26d2465a6ef09070cb83
Gerrit-Change-Number: 429
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: newchange

Comments

Simon Marchi (Code Review) Nov. 21, 2019, 6:41 p.m. | #1
Pedro Alves has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/429
......................................................................


Patch Set 1: Code-Review+2

OK.


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I929d63d03244def0b7fd26d2465a6ef09070cb83
Gerrit-Change-Number: 429
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Pedro Alves <palves@redhat.com>
Gerrit-Comment-Date: Thu, 21 Nov 2019 18:41:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6ac74cd..dbd1aeb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@ 
 2019-10-29  Tom Tromey  <tromey@adacore.com>
 
+	* 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-10-29  Tom Tromey  <tromey@adacore.com>
+
 	* 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 133fc9c..8ebde45 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_stop> pending_stops;
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h
index 3ab1af6..235ac1a 100644
--- a/gdb/nat/windows-nat.h
+++ b/gdb/nat/windows-nat.h
@@ -148,13 +148,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;
 
@@ -228,7 +221,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);