From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72362 invoked by alias); 20 Aug 2019 19:38:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 72354 invoked by uid 89); 20 Aug 2019 19:38:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Gm-Message-State:APjAAAV X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Aug 2019 19:38:16 +0000 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDA46796FC for ; Tue, 20 Aug 2019 19:38:14 +0000 (UTC) Received: by mail-wr1-f69.google.com with SMTP id k8so6447702wrx.19 for ; Tue, 20 Aug 2019 12:38:14 -0700 (PDT) Received: from ?IPv6:2001:8a0:f913:f700:4c97:6d52:2cea:997b? ([2001:8a0:f913:f700:4c97:6d52:2cea:997b]) by smtp.gmail.com with ESMTPSA id f6sm42073913wrh.30.2019.08.20.12.38.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Aug 2019 12:38:12 -0700 (PDT) Subject: Re: Move gdbsupport to the top level To: Tom Tromey , gdb-patches@sourceware.org References: <87lfx4z3lx.fsf@tromey.com> From: Pedro Alves Message-ID: <2c6c79e9-8a36-6b35-67f4-5cf92f03f8db@redhat.com> Date: Tue, 20 Aug 2019 19:38:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <87lfx4z3lx.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-08/txt/msg00433.txt.bz2 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 . */ > > #include "gdbsupport/common-defs.h" > +#include 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 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