diff options
author | Tom Tromey <tromey@adacore.com> | 2020-04-08 14:33:35 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-04-08 14:47:59 -0600 |
commit | 2c1d95e8697f64713d0f60f7b9231d13a3f6a145 (patch) | |
tree | 6e6bc6f0c78b9a706f108cab3a6fcf7c9a125cf3 /gdb | |
parent | d2977bc4253614907058d3a339875683d8215065 (diff) | |
download | fsf-binutils-gdb-2c1d95e8697f64713d0f60f7b9231d13a3f6a145.zip fsf-binutils-gdb-2c1d95e8697f64713d0f60f7b9231d13a3f6a145.tar.gz fsf-binutils-gdb-2c1d95e8697f64713d0f60f7b9231d13a3f6a145.tar.bz2 |
Move wait_for_debug_event to nat/windows-nat.c
This moves the wait_for_debug_event helper function to
nat/windows-nat.c, and changes gdbserver to use it.
wait_for_debug_event is a wrapper for WaitForDebugEvent that also sets
last_wait_event when appropriate. This is needed to properly handle
queued stops.
gdb/ChangeLog
2020-04-08 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.
* nat/windows-nat.c (wait_for_debug_event): Move from
windows-nat.c. No longer static.
gdbserver/ChangeLog
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (win32_kill, get_child_debug_event): Use
wait_for_debug_event.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/nat/windows-nat.c | 10 | ||||
-rw-r--r-- | gdb/nat/windows-nat.h | 5 | ||||
-rw-r--r-- | gdb/windows-nat.c | 11 |
4 files changed, 23 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 738c6c2..3c3ae28 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2020-04-08 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. + * nat/windows-nat.c (wait_for_debug_event): Move from + windows-nat.c. No longer static. + +2020-04-08 Tom Tromey <tromey@adacore.com> + * windows-nat.c (get_windows_debug_event): Use fetch_pending_stop. * nat/windows-nat.h (fetch_pending_stop): Declare. diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index 823471e..bb28e9b 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -385,5 +385,15 @@ continue_last_debug_event (DWORD continue_status, bool debug_events) continue_status); } +/* See nat/windows-nat.h. */ + +BOOL +wait_for_debug_event (DEBUG_EVENT *event, DWORD timeout) +{ + BOOL result = WaitForDebugEvent (event, timeout); + if (result) + last_wait_event = *event; + return result; +} } diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 68b72d4..846fa67 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -245,6 +245,11 @@ extern gdb::optional<pending_stop> fetch_pending_stop (bool debug_events); extern BOOL continue_last_debug_event (DWORD continue_status, bool debug_events); +/* A simple wrapper for WaitForDebugEvent that also sets + 'last_wait_event' on success. */ + +extern BOOL wait_for_debug_event (DEBUG_EVENT *event, DWORD timeout); + } #endif diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 2ee7a24..cdaca8d 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1495,17 +1495,6 @@ ctrl_c_handler (DWORD event_type) return TRUE; } -/* A wrapper for WaitForDebugEvent that sets "last_wait_event" - appropriately. */ -static BOOL -wait_for_debug_event (DEBUG_EVENT *event, DWORD timeout) -{ - BOOL result = WaitForDebugEvent (event, timeout); - if (result) - last_wait_event = *event; - return result; -} - /* Get the next event from the child. Returns a non-zero thread id if the event requires handling by WFI (or whatever). */ |