summaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-06-24 15:06:26 +0000
committerTom Tromey <tromey@redhat.com>2013-06-24 15:06:26 +0000
commitf4f9399f80652e95afa0b4c2e099508cc6b2646d (patch)
tree3d2ee6b958f21dc895bb40f1187328258a2a52bb /gdb/gdbserver
parent61f6db26fad51a7a4b2d4d61a134d5f98cbdf1e1 (diff)
downloadgdb-f4f9399f80652e95afa0b4c2e099508cc6b2646d.tar.gz
don't keep a gdb-specific date
Right now there are two nightly commits to update a file in the tree with the current date. One commit is for BFD, one is for gdb. It seems unnecessary to me to do this twice. We can make do with a single such commit. This patch changes gdb in a minimal way to reuse the BFD date -- it extracts it from bfd/version.h and changes version.in to use the placeholder string "DATE" for those times when a date is wanted. I propose removing the cron job that updates the version on trunk, and then check in this patch. For release branches, we can keep the cron job, but just tell it to rewrite bfd/version.h. I believe this is a simple change in the crontab -- the script will work just fine on this file. This also moves version.in and version.h into common/, to reflect their shared status; and updates gdbserver to use version.h besides. * common/create-version.sh: New file. * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (HFILES_NO_SRCDIR): Use common/version.h. * version.in: Move to ... * common/version.in: ... here. Replace date with "DATE". * version.h: Move to ... * common/version.h: ... here. gdbserver: * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (version.o): Remove. * gdbreplay.c: Include version.h. (version, host_name): Don't declare. * server.h: Include version.h. (version, host_name): Don't declare. doc: * Makefile.in (POD2MAN1, POD2MAN5): Use version.subst. (GDBvn.texi): Use version.subst. (version.subst): New target. (mostlyclean): Remove version.subst.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog10
-rw-r--r--gdb/gdbserver/Makefile.in10
-rw-r--r--gdb/gdbserver/gdbreplay.c5
-rw-r--r--gdb/gdbserver/server.h5
4 files changed, 15 insertions, 15 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index b15614a3967..31e71c4f60a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,13 @@
+2013-06-24 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in (version.c): Use bfd/version.h, common/version.in,
+ create-version.sh.
+ (version.o): Remove.
+ * gdbreplay.c: Include version.h.
+ (version, host_name): Don't declare.
+ * server.h: Include version.h.
+ (version, host_name): Don't declare.
+
2013-06-12 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (linux_is_elf64): Delete global.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index e8470a81749..e5ecdd36796 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -389,13 +389,9 @@ am--refresh:
force:
-version.c: Makefile $(srcdir)/../version.in
- rm -f version.c-tmp version.c
- echo '#include "server.h"' >> version.c-tmp
- echo 'const char version[] = "'"`sed q ${srcdir}/../version.in`"'";' >> version.c-tmp
- echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp
- mv version.c-tmp version.c
-version.o: version.c $(server_h)
+version.c: Makefile $(srcdir)/../common/version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh
+ $(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \
+ $(host_alias) $(target_alias) version.c
xml-builtin.c: stamp-xml; @true
stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 0aa52d8fcbf..c0d0c8f15ce 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -19,6 +19,7 @@
#include "config.h"
#include "build-gnulib-gdbserver/config.h"
+#include "version.h"
#include <stdio.h>
#if HAVE_SYS_FILE_H
@@ -72,10 +73,6 @@ typedef int socklen_t;
/* Sort of a hack... */
#define EOL (EOF - 1)
-/* Version information, from version.c. */
-extern const char version[];
-extern const char host_name[];
-
static int remote_desc;
#ifdef __MINGW32CE__
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 18d060c268b..c68c6515c08 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -28,6 +28,7 @@
#include "libiberty.h"
#include "ansidecl.h"
+#include "version.h"
#include <stdarg.h>
#include <stdio.h>
@@ -531,8 +532,4 @@ CORE_ADDR get_set_tsv_func_addr (void);
extern CORE_ADDR current_insn_ptr;
extern int emit_error;
-/* Version information, from version.c. */
-extern const char version[];
-extern const char host_name[];
-
#endif /* SERVER_H */