From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80220 invoked by alias); 26 Dec 2016 21:34:51 -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 80198 invoked by uid 89); 26 Dec 2016 21:34:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=adjustments, 2017 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Dec 2016 21:34:40 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1cLcul-0002RZ-DY from Luis_Gustavo@mentor.com ; Mon, 26 Dec 2016 13:34:39 -0800 Received: from [172.30.6.27] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 26 Dec 2016 13:34:36 -0800 From: Luis Machado Subject: Re: [PATCH 1/6] Share gdb/environ.[ch] with gdbserver Reply-To: Luis Machado References: <1482464361-4068-1-git-send-email-sergiodj@redhat.com> <1482464361-4068-2-git-send-email-sergiodj@redhat.com> To: Sergio Durigan Junior , GDB Patches CC: Message-ID: Date: Mon, 26 Dec 2016 21:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1482464361-4068-2-git-send-email-sergiodj@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00420.txt.bz2 On 12/22/2016 09:39 PM, Sergio Durigan Junior wrote: > 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: > 2016-12-22 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: > 2016-12-22 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 946d440..051f07d 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -1047,7 +1047,6 @@ SFILES = \ > dwarf2loc.c \ > dwarf2read.c \ > elfread.c \ > - environ.c \ > eval.c \ > event-loop.c \ > event-top.c \ > @@ -1192,6 +1191,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 \ > @@ -1270,7 +1270,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 5c73757..105f854 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 e17cf70..fe40842 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) > Looks good to me.