Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Girish Shilamkar <girish@linsyssoft.com>
To: gdb-patches@sources.redhat.com
Subject: Version string added to gdbserver
Date: Tue, 31 Jan 2006 10:58:00 -0000	[thread overview]
Message-ID: <1138705200.3213.12.camel@krypton> (raw)

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

Hi,
	gdbserver Makefile consists of following line:

# Perhaps should come from parent Makefile
VERSION = gdbserver-4.12.3

	In order to know which gdbserver is being run, the following patch
prints gdbserver version when gdbserver is started. 
	Should the gdb version also be displayed, from which gdbserver was
built (i.e gdb 6.4 etc), since gdbserver built from different gdb
versions may be different even if gdbserver version is same?

-Girish.

[-- Attachment #2: gdbserver_version.patch --]
[-- Type: text/x-patch, Size: 2733 bytes --]

Index: gdb/gdbserver/Makefile.in
===================================================================
--- gdb.orig/gdbserver/Makefile.in	2006-01-31 14:44:32.000000000 +0530
+++ gdb/gdbserver/Makefile.in	2006-01-31 14:57:21.000000000 +0530
@@ -126,7 +126,8 @@
 	$(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
 	$(srcdir)/linux-ppc-low.c $(srcdir)/linux-ppc64-low.c \
 	$(srcdir)/linux-s390-low.c \
-	$(srcdir)/linux-sh-low.c $(srcdir)/linux-x86-64-low.c
+	$(srcdir)/linux-sh-low.c $(srcdir)/linux-x86-64-low.c \
+        $(srcdir)/version.c
 
 DEPFILES = @GDBSERVER_DEPFILES@
 
@@ -136,6 +137,7 @@
 OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
 	utils.o \
 	mem-break.o \
+	version.o \
 	$(DEPFILES)
 GDBSERVER_LIBS = @GDBSERVER_LIBS@
 
@@ -204,6 +206,7 @@
 	rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m32r.c reg-m68k.c reg-mips.c
 	rm -f reg-ppc.c reg-sh.c reg-x86-64.c reg-i386-linux.c
 	rm -f reg-cris.c reg-crisv32.c
+	rm -f version.c 
 
 maintainer-clean realclean distclean: clean
 	rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
@@ -224,7 +227,8 @@
 force:
 
 version.c: Makefile
-	echo 'char *version = "$(VERSION)";' >version.c
+	echo '#include "version.h"' >version.c
+	echo 'const char version[] = "$(VERSION)";' >>version.c
 
 # GNU Make has an annoying habit of putting *all* the Makefile variables
 # into the environment, unless you include this target as a circumvention.
@@ -243,7 +247,9 @@
 regcache_h = $(srcdir)/regcache.h
 server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
 		$(srcdir)/mem-break.h
+version_h = $(srcdir)/version.h
 
+version.o: version.c $(server_h)
 inferiors.o: inferiors.c $(server_h)
 mem-break.o: mem-break.c $(server_h)
 proc-service.o: proc-service.c $(server_h) $(gdb_proc_service_h)
Index: gdb/gdbserver/version.h
===================================================================
--- gdb.orig/gdbserver/version.h	2006-01-31 11:29:08.772974888 +0530
+++ gdb/gdbserver/version.h	2006-01-31 15:10:21.293967032 +0530
@@ -0,0 +1,8 @@
+#ifndef VERSION_H
+#define VERSION_H
+
+/* Version number of gdbserver, as a string.  */
+extern const char version[];
+
+#endif /* #ifndef VERSION_H */
+
Index: gdb/gdbserver/server.c
===================================================================
--- gdb.orig/gdbserver/server.c	2006-01-31 14:52:10.000000000 +0530
+++ gdb/gdbserver/server.c	2006-01-31 14:59:11.098852176 +0530
@@ -21,6 +21,7 @@
    Boston, MA 02110-1301, USA.  */
 
 #include "server.h"
+#include "version.h"
 
 #include <unistd.h>
 #include <signal.h>
@@ -358,6 +359,8 @@
 
   initialize_low ();
 
+  fprintf(stderr, "GNU %s\n",version);
+
   own_buf = malloc (PBUFSIZ);
   mem_buf = malloc (PBUFSIZ);
 

             reply	other threads:[~2006-01-31 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-31 10:58 Girish Shilamkar [this message]
2006-02-01 21:37 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1138705200.3213.12.camel@krypton \
    --to=girish@linsyssoft.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox