This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/9][gdbserver] Split server.h.


The recurring theme of doing:

 #ifdef GDBSERVER
 #include "server.h"
 #else
 #include "defs.h"
 #endif

in common/ code is a bit annoying.  I think we'll end up proving a
defs.h in gdbserver, and we'll want to share as much with gdb's as
possible.

I considered just renaming server.h to defs.h, but looking at
server.h, I think it's better to first split out things that don't
really need to be there.  Now that gdbserver's Makefile does automatic
dependency tracking, it's easy enough to split the parts that actually
define interfaces of specific modules to their own files.  This series
does that.  Some of the new headers remain included in server.h (at
least for now), for they define things that are truly used throughout
the code, and I was hating the fact that I was ending up adding
#include remote-utils.h throughout in a previous attempt, with "utils"
being yet another kitchensink, which I prefer avoiding.  Still, I
think it still makes things clearer this way.

I think we should do the same on the gdb side too.

Tested on x86_64 Fedora 17.  I'll apply it tomorrow, barring comments.

Pedro Alves (9):
  [gdbserver] Delete _ macro (gettext).
  [gdbserver] Split a new remote-utils.h file out of server.h.
  [gdbserver] Split a new utils.h file out of server.h.
  [gdbserver] Split a new tracepoint.h file out of server.h.
  [gdbserver] Split a new ax.h file out of server.h.
  [gdbserver] Split a new inferiors.h file out of server.h.
  [gdbserver] Split a new dll.h file out of server.h.
  [gdbserver] Split a new event-loop.h file out of server.h.
  [gdbserver] Split a new hostio.h file out of server.h.

 gdb/gdbserver/ax.c            |   1 +
 gdb/gdbserver/ax.h            |  57 +++++++
 gdb/gdbserver/dll.c           |   1 +
 gdb/gdbserver/dll.h           |  35 ++++
 gdb/gdbserver/event-loop.h    |  36 ++++
 gdb/gdbserver/gdbthread.h     |   1 +
 gdb/gdbserver/hostio.c        |   1 +
 gdb/gdbserver/hostio.h        |  28 +++
 gdb/gdbserver/inferiors.c     |   1 +
 gdb/gdbserver/inferiors.h     | 114 +++++++++++++
 gdb/gdbserver/linux-low.c     |   2 +
 gdb/gdbserver/linux-x86-low.c |   2 +
 gdb/gdbserver/remote-utils.c  |   2 +
 gdb/gdbserver/remote-utils.h  |  85 ++++++++++
 gdb/gdbserver/server.c        |   3 +
 gdb/gdbserver/server.h        | 385 +-----------------------------------------
 gdb/gdbserver/target.c        |   1 +
 gdb/gdbserver/target.h        |   1 +
 gdb/gdbserver/tracepoint.c    |   1 +
 gdb/gdbserver/tracepoint.h    | 132 +++++++++++++++
 gdb/gdbserver/utils.h         |  32 ++++
 21 files changed, 541 insertions(+), 380 deletions(-)
 create mode 100644 gdb/gdbserver/dll.h
 create mode 100644 gdb/gdbserver/event-loop.h
 create mode 100644 gdb/gdbserver/hostio.h
 create mode 100644 gdb/gdbserver/inferiors.h
 create mode 100644 gdb/gdbserver/remote-utils.h
 create mode 100644 gdb/gdbserver/tracepoint.h
 create mode 100644 gdb/gdbserver/utils.h

-- 
1.7.11.7


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]