From patchwork Tue Oct 29 17:57:55 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: 35422 Received: (qmail 48925 invoked by alias); 29 Oct 2019 17:58:13 -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 48223 invoked by uid 89); 29 Oct 2019 17:58:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 required=5.0 tests=AWL, 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, 29 Oct 2019 17:58:07 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 5E2AF20D23; Tue, 29 Oct 2019 13:58:06 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id DDA662134A for ; Tue, 29 Oct 2019 13:57:55 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id D1D8620AF6 for ; Tue, 29 Oct 2019 13:57:55 -0400 (EDT) X-Gerrit-PatchSet: 1 Date: Tue, 29 Oct 2019 13:57:55 -0400 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Normalize get_windows_debug_event API X-Gerrit-Change-Id: I4d6767efb32de5b36d944b0defdfbeac4009dbb7 X-Gerrit-Change-Number: 421 X-Gerrit-ChangeURL: X-Gerrit-Commit: 90ec1de160a96197c917770d2a52bea9019c18d7 References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-74-g460fb0f7e9 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/421 ...................................................................... Normalize get_windows_debug_event API This changes gdb's implementation of get_windows_debug_event to have the same API as that of gdbserver. This allows more code sharing in a subsequent patch. Change-Id: Ib279ec62e72b3f42a8dec172154df24c6911fefa gdb/ChangeLog 2019-10-29 Tom Tromey * windows-nat.c (get_windows_debug_event): Remove parameters. (windows_nat_target::wait): Update. Change-Id: I4d6767efb32de5b36d944b0defdfbeac4009dbb7 --- M gdb/ChangeLog M gdb/windows-nat.c 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 81c52ca..d706ebb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2019-10-29 Tom Tromey + * windows-nat.c (get_windows_debug_event): Remove parameters. + (windows_nat_target::wait): Update. + +2019-10-29 Tom Tromey + * windows-nat.c (windows_nat::handle_output_debug_string): Rename. No longer static. * nat/windows-nat.h (handle_output_debug_string): Declare. diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 38b3828..d175bd7 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1465,8 +1465,7 @@ /* Get the next event from the child. Returns a non-zero thread id if the event requires handling by WFI (or whatever). */ static int -get_windows_debug_event (struct target_ops *ops, - int pid, struct target_waitstatus *ourstatus) +get_windows_debug_event (struct target_waitstatus *ourstatus) { BOOL debug_event; DWORD continue_status, event_code; @@ -1706,8 +1705,6 @@ windows_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options) { - int pid = -1; - /* We loop when we get a non-standard exception rather than return with a SPURIOUS because resume can try and step or modify things, which needs a current_thread->h. But some of these exceptions mark @@ -1745,7 +1742,7 @@ the user tries to resume the execution in the inferior. This is a classic race that we should try to fix one day. */ SetConsoleCtrlHandler (&ctrl_c_handler, TRUE); - retval = get_windows_debug_event (this, pid, ourstatus); + retval = get_windows_debug_event (ourstatus); SetConsoleCtrlHandler (&ctrl_c_handler, FALSE); if (retval)