This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Share gdb/environ.[ch] with gdbserver


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1672e0d98d88d11b5c7d5793bd2cf29cbb56696f

commit 1672e0d98d88d11b5c7d5793bd2cf29cbb56696f
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Thu Dec 22 09:20:00 2016 -0500

    Share gdb/environ.[ch] with gdbserver
    
    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-03-07  Sergio Durigan Junior  <sergiodj@redhat.com>
    
    	* 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-03-07  Sergio Durigan Junior  <sergiodj@redhat.com>
    
    	* Makefile.in (SFILES): Add "common/environ.c".
    	(OBJS): Add "common/environ.h".

Diff:
---
 gdb/ChangeLog              | 11 +++++++++++
 gdb/Makefile.in            |  4 ++--
 gdb/{ => common}/environ.c |  2 +-
 gdb/{ => common}/environ.h |  0
 gdb/gdbserver/ChangeLog    |  5 +++++
 gdb/gdbserver/Makefile.in  |  5 +++++
 6 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2427b10..3a156ad 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2017-03-07  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+	* 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.
+
 2017-03-07  Peter Bergner  <bergner@vnet.ibm.com>
 
 	* gdbarch.sh (pstring_ptr): New static function.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 268c2c6..0818742 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1061,7 +1061,6 @@ SFILES = \
 	dwarf2loc.c \
 	dwarf2read.c \
 	elfread.c \
-	environ.c \
 	eval.c \
 	event-loop.c \
 	event-top.c \
@@ -1207,6 +1206,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 \
@@ -1285,7 +1285,6 @@ HFILES_NO_SRCDIR = \
 	dwarf2-frame-tailcall.h \
 	dwarf2expr.h \
 	dwarf2loc.h \
-	environ.h \
 	event-loop.h \
 	event-top.h \
 	exceptions.h \
@@ -1486,6 +1485,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 <http://www.gnu.org/licenses/>.  */
 
-#include "defs.h"
+#include "common-defs.h"
 #include "environ.h"
 #include <algorithm>
 
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/ChangeLog b/gdb/gdbserver/ChangeLog
index 79fe2f9..a3e60f8 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-07  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+	* Makefile.in (SFILES): Add "common/environ.c".
+	(OBJS): Add "common/environ.h".
+
 2017-01-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>
 
 	* configure.ac: Check if the fs_base and gs_base members of
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index c2354d2..1cccbbf 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 \
@@ -782,6 +784,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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]