From patchwork Tue Nov 26 17:11:31 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: 36218 Received: (qmail 94283 invoked by alias); 26 Nov 2019 17:11:57 -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 94214 invoked by uid 89); 26 Nov 2019 17:11:57 -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=wraps, clashes 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:11:55 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id E34AD2064A; Tue, 26 Nov 2019 12:11:53 -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 0529B20A87 for ; Tue, 26 Nov 2019 12:11:32 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id EF1E520AF6 for ; Tue, 26 Nov 2019 12:11:31 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Tue, 26 Nov 2019 12:11:31 -0500 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Wrap shared windows-nat code in windows_nat namespace X-Gerrit-Change-Id: I849284860100a0028e611786e021e95f4bc4b579 X-Gerrit-Change-Number: 707 X-Gerrit-ChangeURL: X-Gerrit-Commit: b862d436b8119a2c6a70f9421f1c971e1f4aa8bc 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/+/707 ...................................................................... Wrap shared windows-nat code in windows_nat namespace This wraps the shared windows-nat code in a windows_nat namespace. This helps avoid name clashes. gdb/ChangeLog 2019-11-26 Tom Tromey * windows-nat.c: Add "using namespace". * nat/windows-nat.h: Wrap contents in windows_nat namespace. * nat/windows-nat.c: Wrap contents in windows_nat namespace. gdb/gdbserver/ChangeLog 2019-11-26 Tom Tromey * win32-low.h: Add "using namespace". Change-Id: I849284860100a0028e611786e021e95f4bc4b579 --- M gdb/ChangeLog M gdb/gdbserver/ChangeLog M gdb/gdbserver/win32-low.h M gdb/nat/windows-nat.c M gdb/nat/windows-nat.h M gdb/windows-nat.c 6 files changed, 24 insertions(+), 0 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 08d2ecb..a613484 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2019-11-26 Tom Tromey + * windows-nat.c: Add "using namespace". + * nat/windows-nat.h: Wrap contents in windows_nat namespace. + * nat/windows-nat.c: Wrap contents in windows_nat namespace. + +2019-11-26 Tom Tromey + * nat/windows-nat.h (struct windows_thread_info): Declare destructor. * nat/windows-nat.c (~windows_thread_info): New. diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 6dcb274..03fcd87 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,9 @@ 2019-11-26 Tom Tromey + * win32-low.h: Add "using namespace". + +2019-11-26 Tom Tromey + * win32-low.c (delete_thread_info): Don't call CloseHandle. 2019-11-26 Tom Tromey diff --git a/gdb/gdbserver/win32-low.h b/gdb/gdbserver/win32-low.h index 342411d..5a94686 100644 --- a/gdb/gdbserver/win32-low.h +++ b/gdb/gdbserver/win32-low.h @@ -22,6 +22,8 @@ #include #include "nat/windows-nat.h" +using namespace windows_nat; + struct target_desc; /* The inferior's target description. This is a global because the diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index e5a12c3..375ceb7 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -19,6 +19,9 @@ #include "gdbsupport/common-defs.h" #include "nat/windows-nat.h" +namespace windows_nat +{ + windows_thread_info::~windows_thread_info () { CloseHandle (h); @@ -65,3 +68,5 @@ } suspended = 0; } + +} diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 8535a15..2f9b181 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -21,6 +21,9 @@ #include +namespace windows_nat +{ + /* Thread information structure used to track extra information about each thread. */ struct windows_thread_info @@ -81,4 +84,6 @@ gdb::unique_xmalloc_ptr name; }; +} + #endif diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 8448d1c..198bb5a 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -71,6 +71,8 @@ #include "gdbsupport/pathstuff.h" #include "nat/windows-nat.h" +using namespace windows_nat; + #define AdjustTokenPrivileges dyn_AdjustTokenPrivileges #define DebugActiveProcessStop dyn_DebugActiveProcessStop #define DebugBreakProcess dyn_DebugBreakProcess