This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/7] Move some integer operations to common.
- From: Gary Benson <gbenson at redhat dot com>
- To: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 14 Sep 2015 10:24:53 +0100
- Subject: Re: [PATCH 2/7] Move some integer operations to common.
- Authentication-results: sourceware.org; auth=none
- References: <1441973603-15247-1-git-send-email-antoine dot tremblay at ericsson dot com> <1441973603-15247-3-git-send-email-antoine dot tremblay at ericsson dot com> <20150911142442 dot GA23515 at blade dot nx> <55F30C55 dot 3080507 at ericsson dot com> <55F31019 dot 1080607 at ericsson dot com>
Antoine Tremblay wrote:
> On 09/11/2015 01:16 PM, Antoine Tremblay wrote:
> > On 09/11/2015 10:24 AM, Gary Benson wrote:
> > > Please don't introduce "#ifdef GDBSERVER" conditionals into
> > > common code, I spent some time removing them. I know I didn't
> > > get them all, but the remaining two are on my hit list.
> >
> > Humm what is the issue that makes this a bad idea if I may ?
The way the common code is built is currently kind of weird and ugly.
Even though the code is shared, there's still places you have to do
the same work twice, for example if you add a new .c or .h file to
common, for example, you have to add it to both GDB's and gdbserver's
Makefiles. If you add stuff that needs configure checks, you have to
add those twice too. Also we build gnulib twice. Also, the way the
compiler is invoked means that you can accidentally #include GDB- or
gdbserver-specific headers in common code. It's all very error-prone.
For the future we'd like to move the common code into its own toplevel
directory with it's own Makefile, it's own ./configure, etc. It would
be built once, to a libgdbcommon.a or something that GDB and gdbserver
would statically link. We can't do that if gdb/{common,nat,target}
have conditional code.
Thanks,
Gary
--
http://gbenson.net/