public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [review] Wrap shared windows-nat code in windows_nat namespace
@ 2019-10-29 17:58 Tom Tromey (Code Review)
  2019-11-26 22:54 ` Luis Machado (Code Review)
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey (Code Review) @ 2019-10-29 17:58 UTC (permalink / raw)
  To: gdb-patches

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

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.

Change-Id: I849284860100a0028e611786e021e95f4bc4b579

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

	* 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-10-29  Tom Tromey  <tromey@adacore.com>

	* win32-low.h: Add "using namespace".

Change-Id: I56105d1c87a4170377364351dddf9f71be182546
---
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 2a63867..6b6159b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2019-10-29  Tom Tromey  <tromey@adacore.com>
 
+	* 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-10-29  Tom Tromey  <tromey@adacore.com>
+
 	* 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 fb1c7bc..5b73d88 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,9 @@
 2019-10-29  Tom Tromey  <tromey@adacore.com>
 
+	* win32-low.h: Add "using namespace".
+
+2019-10-29  Tom Tromey  <tromey@adacore.com>
+
 	* win32-low.c (delete_thread_info): Don't call CloseHandle.
 
 2019-10-29  Tom Tromey  <tromey@adacore.com>
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 <windows.h>
 #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 2a0e3a3..725860c 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);
@@ -63,3 +66,5 @@
     }
   suspended = 0;
 }
+
+}
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h
index d1bdea2..81d8ed2 100644
--- a/gdb/nat/windows-nat.h
+++ b/gdb/nat/windows-nat.h
@@ -21,6 +21,9 @@
 
 #include <windows.h>
 
+namespace windows_nat
+{
+
 /* Thread information structure used to track extra information about
    each thread.  */
 struct windows_thread_info
@@ -77,4 +80,6 @@
   gdb::unique_xmalloc_ptr<char> name;
 };
 
+}
+
 #endif
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 1249778..776f151 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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review] Wrap shared windows-nat code in windows_nat namespace
  2019-10-29 17:58 [review] Wrap shared windows-nat code in windows_nat namespace Tom Tromey (Code Review)
@ 2019-11-26 22:54 ` Luis Machado (Code Review)
  0 siblings, 0 replies; 5+ messages in thread
From: Luis Machado (Code Review) @ 2019-11-26 22:54 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

Luis Machado has posted comments on this change.

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


Patch Set 1: Code-Review+1

Looks OK.


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I56105d1c87a4170377364351dddf9f71be182546
Gerrit-Change-Number: 416
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Comment-Date: Tue, 26 Nov 2019 22:54:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review] Wrap shared windows-nat code in windows_nat namespace
  2019-11-26 17:11 Tom Tromey (Code Review)
  2019-11-29 19:12 ` Pedro Alves (Code Review)
@ 2019-12-04 15:45 ` Tom Tromey (Code Review)
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Tromey (Code Review) @ 2019-12-04 15:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pedro Alves

Tom Tromey has posted comments on this change.

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


Patch Set 1:

(1 comment)

| --- gdb/gdbserver/win32-low.h
| +++ gdb/gdbserver/win32-low.h
| @@ -16,17 +16,19 @@ /* Internal interfaces for the Win32 specific target code for gdbserver.
|     You should have received a copy of the GNU General Public License
|     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
|  
|  #ifndef GDBSERVER_WIN32_LOW_H
|  #define GDBSERVER_WIN32_LOW_H
|  
|  #include <windows.h>
|  #include "nat/windows-nat.h"
|  
| +using namespace windows_nat;

PS1, Line 25:

> Seems a bit icky to do this in a header.  Would it complicate things to avoid it?

It turned out not to be too bad.

| +
|  struct target_desc;
|  
|  /* The inferior's target description.  This is a global because the
|     Windows ports support neither bi-arch nor multi-process.  */
|  extern const struct target_desc *win32_tdesc;
|  
|  struct win32_target_ops
|  {

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I849284860100a0028e611786e021e95f4bc4b579
Gerrit-Change-Number: 707
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Pedro Alves <palves@redhat.com>
Gerrit-Comment-Date: Wed, 04 Dec 2019 15:45:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Pedro Alves <palves@redhat.com>
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review] Wrap shared windows-nat code in windows_nat namespace
  2019-11-26 17:11 Tom Tromey (Code Review)
@ 2019-11-29 19:12 ` Pedro Alves (Code Review)
  2019-12-04 15:45 ` Tom Tromey (Code Review)
  1 sibling, 0 replies; 5+ messages in thread
From: Pedro Alves (Code Review) @ 2019-11-29 19:12 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

Pedro Alves has posted comments on this change.

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


Patch Set 1:

(1 comment)

| --- gdb/gdbserver/win32-low.h
| +++ gdb/gdbserver/win32-low.h
| @@ -16,17 +16,19 @@ /* Internal interfaces for the Win32 specific target code for gdbserver.
|     You should have received a copy of the GNU General Public License
|     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
|  
|  #ifndef GDBSERVER_WIN32_LOW_H
|  #define GDBSERVER_WIN32_LOW_H
|  
|  #include <windows.h>
|  #include "nat/windows-nat.h"
|  
| +using namespace windows_nat;

PS1, Line 25:

Seems a bit icky to do this in a header.  Would it complicate things
to avoid it?

| +
|  struct target_desc;
|  
|  /* The inferior's target description.  This is a global because the
|     Windows ports support neither bi-arch nor multi-process.  */
|  extern const struct target_desc *win32_tdesc;
|  
|  struct win32_target_ops
|  {

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I849284860100a0028e611786e021e95f4bc4b579
Gerrit-Change-Number: 707
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Pedro Alves <palves@redhat.com>
Gerrit-Comment-Date: Fri, 29 Nov 2019 19:12:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review] Wrap shared windows-nat code in windows_nat namespace
@ 2019-11-26 17:11 Tom Tromey (Code Review)
  2019-11-29 19:12 ` Pedro Alves (Code Review)
  2019-12-04 15:45 ` Tom Tromey (Code Review)
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Tromey (Code Review) @ 2019-11-26 17:11 UTC (permalink / raw)
  To: gdb-patches

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  <tromey@adacore.com>

	* 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  <tromey@adacore.com>

	* 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  <tromey@adacore.com>
 
+	* 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  <tromey@adacore.com>
+
 	* 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  <tromey@adacore.com>
 
+	* win32-low.h: Add "using namespace".
+
+2019-11-26  Tom Tromey  <tromey@adacore.com>
+
 	* win32-low.c (delete_thread_info): Don't call CloseHandle.
 
 2019-11-26  Tom Tromey  <tromey@adacore.com>
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 <windows.h>
 #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 <windows.h>
 
+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<char> 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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-04 15:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29 17:58 [review] Wrap shared windows-nat code in windows_nat namespace Tom Tromey (Code Review)
2019-11-26 22:54 ` Luis Machado (Code Review)
2019-11-26 17:11 Tom Tromey (Code Review)
2019-11-29 19:12 ` Pedro Alves (Code Review)
2019-12-04 15:45 ` Tom Tromey (Code Review)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).