From: Gary Benson <gbenson@redhat.com>
To: Doug Evans <dje@google.com>
Cc: Pedro Alves <palves@redhat.com>,
gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
Subject: Re: [PATCH 1/3 v4] Introduce common/errors.h
Date: Fri, 25 Jul 2014 08:51:00 -0000 [thread overview]
Message-ID: <20140725083642.GA4812@blade.nx> (raw)
In-Reply-To: <21457.18385.59886.323894@ruffy.mtv.corp.google.com>
Doug Evans wrote:
> Pedro Alves writes:
> > > + You should have received a copy of the GNU General Public License
> > > + along with this program. If not, see <http://www.gnu.org/licenses/>. */
> > > +
> > > +#include "config.h"
> >
> > Sorry for the push back, but it's wrong to only include "config.h".
> > We need to include gnulib's config.h everywhere too. I think
> > the best is to add a central common header that handles that
> > detail first.
>
> OTOH,
> just including "config.h" is a real common thing to do across all
> packages. I can imagine this coming up again and again.
>
> IWBN if hacking on gdb didn't require special cases to standard
> programming paradigms wherever possible. Can we arrange for
> config.h to include gnulib's config.h? Or, another thought would be
> to have configure generate gdb-config.h (or some such) and then have
> src/gdb/config.h include both (and similarly for gdbserver - haven't
> looked at the details though).
I'm working on this now. My plan is to have gdb/common/common-defs.h
(which includes config.h and the correct gnulib config.h) and have
defs.h and server.h include common-defs.h as the first line. By the
end of that series most every file will include defs.h or server.h
and no file will include config.h.
At the first instance common-defs.h will include most files included
by both defs.h and server.h. There are various workarounds for
various things in both, and it would be good to have these workarounds
the same for all of GDB/gdbserver/etc. I plan to omit alloca.h and
errno.h initially, as these have pretty heavy hacking around them and
they're not needed yet. I'll probably do both at some point, but as
individual patches/serieses.
I'm also going to do some #include cleanups as part of the same
series. For example lots of things include common-utils.h, but
that's currently included by defs.h and server.h (so I'll move it
to common-defs.h) and if every file includes common-defs.h somehow
then nothing needs common-utils.h.
Once the common-defs.h series is finished and pushed I'll rebase
this common-cleanups series on top of it. It'll be much cleaner
and by then the number of "#ifdef GDBSERVER"s in the codebase
will be precisely one (to select the appropriate gnulib config.h
in common-defs.h).
Does all this sound ok?
Cheers,
Gary
--
http://gbenson.net/
next prev parent reply other threads:[~2014-07-25 8:36 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-24 12:51 [PATCH 0/3 v4] Common code cleanups (part 1) Gary Benson
2014-07-24 12:51 ` [PATCH 1/3 v4] Introduce common/errors.h Gary Benson
2014-07-24 13:24 ` Pedro Alves
2014-07-24 18:03 ` Doug Evans
2014-07-25 8:51 ` Gary Benson [this message]
2014-07-25 10:32 ` Pedro Alves
2014-07-25 11:38 ` Gary Benson
2014-07-25 12:13 ` Pedro Alves
2014-07-25 13:34 ` Gary Benson
2014-07-29 16:44 ` Doug Evans
2014-07-29 17:45 ` Pedro Alves
2014-07-30 9:43 ` Gary Benson
2014-07-25 10:19 ` Pedro Alves
2014-07-24 17:52 ` Doug Evans
2014-07-24 22:39 ` Doug Evans
2014-07-25 9:34 ` Gary Benson
2014-07-28 20:16 ` Doug Evans
2014-07-24 12:51 ` [PATCH 2/3 v4] Remove some GDBSERVER checks from linux-ptrace Gary Benson
2014-07-24 13:25 ` Pedro Alves
2014-07-24 14:09 ` Tom Tromey
2014-07-24 14:17 ` Pedro Alves
2014-07-24 14:13 ` [PATCH 2/3 v5] " Gary Benson
2014-07-24 14:25 ` Pedro Alves
2014-07-24 15:05 ` Gary Benson
2014-07-24 13:08 ` [PATCH 3/3 v4] Make gdbserver CORE_ADDR unsigned Gary Benson
2014-07-24 13:36 ` Pedro Alves
2014-07-24 14:07 ` Gary Benson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140725083642.GA4812@blade.nx \
--to=gbenson@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox