[03/11,v5] Move print-utils.h to common-defs.h

Message ID 1406888377-25795-4-git-send-email-gbenson@redhat.com
State Superseded
Headers

Commit Message

Gary Benson Aug. 1, 2014, 10:19 a.m. UTC
  This commit moves the inclusion of print-utils.h to common-defs.h
and removes all other inclusions.

gdb/
2014-08-01  Gary Benson  <gbenson@redhat.com>

	* common/common-defs.h: Include print-utils.h.
	* utils.h: Do not include print-utils.h.

gdb/gdbserver/
2014-08-01  Gary Benson  <gbenson@redhat.com>

	* utils.h: Do not include print-utils.h.
---
 gdb/ChangeLog            |    5 +++++
 gdb/common/common-defs.h |    1 +
 gdb/gdbserver/ChangeLog  |    4 ++++
 gdb/gdbserver/utils.h    |    2 --
 gdb/utils.h              |    1 -
 5 files changed, 10 insertions(+), 3 deletions(-)
  

Comments

Doug Evans Aug. 6, 2014, 4:51 p.m. UTC | #1
Gary Benson writes:
 > This commit moves the inclusion of print-utils.h to common-defs.h
 > and removes all other inclusions.
 > 
 > gdb/
 > 2014-08-01  Gary Benson  <gbenson@redhat.com>
 > 
 > 	* common/common-defs.h: Include print-utils.h.
 > 	* utils.h: Do not include print-utils.h.
 > 
 > gdb/gdbserver/
 > 2014-08-01  Gary Benson  <gbenson@redhat.com>
 > 
 > 	* utils.h: Do not include print-utils.h.
 > ---
 >  gdb/ChangeLog            |    5 +++++
 >  gdb/common/common-defs.h |    1 +
 >  gdb/gdbserver/ChangeLog  |    4 ++++
 >  gdb/gdbserver/utils.h    |    2 --
 >  gdb/utils.h              |    1 -
 >  5 files changed, 10 insertions(+), 3 deletions(-)
 > 
 > diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
 > index 5543e4c..66c0d21 100644
 > --- a/gdb/common/common-defs.h
 > +++ b/gdb/common/common-defs.h
 > @@ -43,5 +43,6 @@
 >  #include "gdb_assert.h"
 >  #include "errors.h"
 >  #include "common-types.h"
 > +#include "print-utils.h"
 >  
 >  #endif /* COMMON_DEFS_H */

It's a bit odd to see common-defs.h include print-utils.h and not
common-utils.h.  I see it gets included by gdb_assert.h, but
as a reader I'm still left with the question of wondering what's
going on and wanting to spend time digging into it.
I wonder if we can improve this somehow.
[No need to work on that in this patch set though.]
  
Gary Benson Aug. 6, 2014, 5:05 p.m. UTC | #2
Doug Evans wrote:
> Gary Benson writes:
> > diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
> > index 5543e4c..66c0d21 100644
> > --- a/gdb/common/common-defs.h
> > +++ b/gdb/common/common-defs.h
> > @@ -43,5 +43,6 @@
> >  #include "gdb_assert.h"
> >  #include "errors.h"
> >  #include "common-types.h"
> > +#include "print-utils.h"
> >  
> >  #endif /* COMMON_DEFS_H */
> 
> It's a bit odd to see common-defs.h include print-utils.h and not
> common-utils.h.  I see it gets included by gdb_assert.h, but
> as a reader I'm still left with the question of wondering what's
> going on and wanting to spend time digging into it.
> I wonder if we can improve this somehow.
> [No need to work on that in this patch set though.]

This version of this series needs to be applied on top of this series:
https://sourceware.org/ml/gdb-patches/2014-07/msg00736.html
common-utils.h is moved into common-defs.h in patch 11 of that series
(and all other inclusions are removed, including the one in gdb_assert.h)

If it helps I have both series in a branch:
https://github.com/gbenson/binutils-gdb/tree/common-defs

Cheers,
Gary
  

Patch

diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
index 5543e4c..66c0d21 100644
--- a/gdb/common/common-defs.h
+++ b/gdb/common/common-defs.h
@@ -43,5 +43,6 @@ 
 #include "gdb_assert.h"
 #include "errors.h"
 #include "common-types.h"
+#include "print-utils.h"
 
 #endif /* COMMON_DEFS_H */
diff --git a/gdb/gdbserver/utils.h b/gdb/gdbserver/utils.h
index a994f38..cdd80df 100644
--- a/gdb/gdbserver/utils.h
+++ b/gdb/gdbserver/utils.h
@@ -19,8 +19,6 @@ 
 #ifndef UTILS_H
 #define UTILS_H
 
-#include "print-utils.h"
-
 void fatal (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
 char *paddress (CORE_ADDR addr);
 char *pfildes (gdb_fildes_t fd);
diff --git a/gdb/utils.h b/gdb/utils.h
index 18a95a7..57a1c0f 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -23,7 +23,6 @@ 
 
 #include "cleanups.h"
 #include "exceptions.h"
-#include "print-utils.h"
 
 extern void initialize_utils (void);