From patchwork Wed Jan 18 15:36:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 18937 Received: (qmail 68687 invoked by alias); 18 Jan 2017 15:36:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 68627 invoked by uid 89); 18 Jan 2017 15:36:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=junior, Junior, obs, similarity 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; Wed, 18 Jan 2017 15:36:16 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82FDA19DE9B; Wed, 18 Jan 2017 15:36:16 +0000 (UTC) Received: from psique.yyz.redhat.com (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0IFaFYM032337; Wed, 18 Jan 2017 10:36:15 -0500 From: Sergio Durigan Junior To: GDB Patches Cc: Pedro Alves , Eli Zaretskii , Luis Machado , Sergio Durigan Junior Subject: [PATCH v2 1/6] Share gdb/environ.[ch] with gdbserver Date: Wed, 18 Jan 2017 10:36:00 -0500 Message-Id: <20170118153605.4610-2-sergiodj@redhat.com> In-Reply-To: <20170118153605.4610-1-sergiodj@redhat.com> References: <1482464361-4068-1-git-send-email-sergiodj@redhat.com> <20170118153605.4610-1-sergiodj@redhat.com> X-IsSubscribed: yes We will need access to the environment functions when we share fork_inferior between GDB and gdbserver, therefore we simply make the API on gdb/environ.[ch] available on common/. No extra adjustments are needed to make it compile on gdbserver. gdb/ChangeLog: 2017-01-17 Sergio Durigan Junior * Makefile.in (SFILES): Replace "environ.c" with "common/environ.c". (HFILES_NO_SRCDIR): Likewise, for "environ.h". * environ.c: Include "common-defs.h" instead of "defs.h. Moved to... * common/environ.c: ... here. * environ.h: Moved to... * common/environ.h: ... here. gdb/gdbserver/ChangeLog: 2017-01-17 Sergio Durigan Junior * Makefile.in (SFILES): Add "common/environ.c". (OBJS): Add "common/environ.h". --- gdb/Makefile.in | 4 ++-- gdb/{ => common}/environ.c | 2 +- gdb/{ => common}/environ.h | 0 gdb/gdbserver/Makefile.in | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) rename gdb/{ => common}/environ.c (99%) rename gdb/{ => common}/environ.h (100%) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 3ce7d69..3f19818 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1048,7 +1048,6 @@ SFILES = \ dwarf2loc.c \ dwarf2read.c \ elfread.c \ - environ.c \ eval.c \ event-loop.c \ event-top.c \ @@ -1193,6 +1192,7 @@ SFILES = \ common/common-regcache.c \ common/common-utils.c \ common/errors.c \ + common/environ.c \ common/fileio.c \ common/filestuff.c \ common/format.c \ @@ -1271,7 +1271,6 @@ HFILES_NO_SRCDIR = \ dwarf2-frame-tailcall.h \ dwarf2expr.h \ dwarf2loc.h \ - environ.h \ event-loop.h \ event-top.h \ exceptions.h \ @@ -1471,6 +1470,7 @@ HFILES_NO_SRCDIR = \ common/common-types.h \ common/common-utils.h \ common/errors.h \ + common/environ.h \ common/fileio.h \ common/format.h \ common/gdb_assert.h \ diff --git a/gdb/environ.c b/gdb/common/environ.c similarity index 99% rename from gdb/environ.c rename to gdb/common/environ.c index bfeabec..3145d01 100644 --- a/gdb/environ.c +++ b/gdb/common/environ.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "defs.h" +#include "common-defs.h" #include "environ.h" #include diff --git a/gdb/environ.h b/gdb/common/environ.h similarity index 100% rename from gdb/environ.h rename to gdb/common/environ.h diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 75736b6..ef0dc99 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -201,6 +201,7 @@ SFILES = \ $(srcdir)/common/common-regcache.c \ $(srcdir)/common/common-utils.c \ $(srcdir)/common/errors.c \ + $(srcdir)/common/environ.c \ $(srcdir)/common/fileio.c \ $(srcdir)/common/filestuff.c \ $(srcdir)/common/gdb_vecs.c \ @@ -238,6 +239,7 @@ OBS = \ debug.o \ dll.o \ errors.o \ + environ.o \ event-loop.o \ fileio.o \ filestuff.o \ @@ -774,6 +776,9 @@ agent.o: ../common/agent.c errors.o: ../common/errors.c $(COMPILE) $< $(POSTCOMPILE) +environ.o: ../common/environ.c + $(COMPILE) $< + $(POSTCOMPILE) common-debug.o: ../common/common-debug.c $(COMPILE) $< $(POSTCOMPILE)