From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: Move gdbsupport to the top level
Date: Tue, 20 Aug 2019 19:38:00 -0000 [thread overview]
Message-ID: <2c6c79e9-8a36-6b35-67f4-5cf92f03f8db@redhat.com> (raw)
In-Reply-To: <87lfx4z3lx.fsf@tromey.com>
Hi,
On 7/11/19 10:02 PM, Tom Tromey wrote:
> This patch moves the gdbsupport directory to the top level. This is
> the next step in the ongoing project to move gdbserver to the top
> level.
>
> The bulk of this patch was created by "git mv gdb/gdbsupport gdbsupport".
>
> This patch then adds a build system to gdbsupport and wires it into
> the top level. Then it changes gdb to use the top-level build.
>
> gdbserver, on the other hand, is not yet changed. It still does its
> own build of gdbsupport.
(I'm looking at the branch, so I'm not sure I'm commenting on the patch
as it was posted.)
This all builds fine for me when I build normally, but,
this breaks building gdbserver standalone, without configuring
from the top level. I.e.:
$ mkdir build-gdbserver
$ cd build-gdbserver
$ .../src/gdb/gdbserver/configure
...
make: *** No rule to make target '../../gdbsupport/libgdbsupport.a', needed by 'gdbserver'. Stop.
make: *** Waiting for unfinished jobs....
...
>
> I wasn't able to send this through the buildbot. I did test it on
> x86-64 Fedora 29. If you want to try it, it is on the branch
> submit/move-gdbsupport-to-top in my github.
>
>
> This patch was also too big to send the usual way, so I have compressed
> it and added it as an attachment. Sorry about that.
The patch is much smaller and easier to read without the
the generated files. It's what I did here locally to try to
make sense of what I was seeing.
> - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) gdbsupport/selftest.o selftest-arch.o"
> - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) gdbsupport/selftest.c selftest-arch.c"
> + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) selftest-arch.o"
> + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) selftest-arch.c"
Spurious double space.
So I guess the biggest change here is how/where config.h is included.
From the branch:
> --- c/gdb/nat/linux-btrace.c
> +++ w/gdb/nat/linux-btrace.c
> @@ -20,6 +20,7 @@
> along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> #include "gdbsupport/common-defs.h"
> +#include <config.h>
I noticed that only a few nat/ files needed to include config.h,
which I found surprising/confusing at first.
What are the new rules here? Add <config.h> on as-needed basis,
or should we have some nat.h file that is included by
all nat/ files, and same for arch/ ? The former seems a bit
error prone, given that you could move code around and not realize
that an #ifdef is disabling something because you missed config.h.
Alternatively, I guess we could move the required bits from
gdb&gdbserver's configury to gdbsupport's, so that config.h
wasn't ever necessary in shared code. Not sure whether that
would be a bit of an abstraction violation.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2019-08-20 19:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 21:03 Tom Tromey
2019-07-12 7:18 ` Andrew Pinski
2019-07-12 13:05 ` Tom Tromey
2019-07-15 20:10 ` Tom Tromey
2019-08-20 19:38 ` Pedro Alves [this message]
2019-08-20 20:22 ` Tom Tromey
2019-09-17 16:11 ` Tom Tromey
2019-09-17 16:16 ` Eli Zaretskii
2019-09-17 16:35 ` Tom Tromey
2019-09-17 16:45 ` Eli Zaretskii
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=2c6c79e9-8a36-6b35-67f4-5cf92f03f8db@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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