From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26944 invoked by alias); 31 Jan 2006 10:58:22 -0000 Received: (qmail 26935 invoked by uid 22791); 31 Jan 2006 10:58:21 -0000 X-Spam-Check-By: sourceware.org Received: from svr68.ehostpros.com (HELO svr68.ehostpros.com) (67.15.48.48) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 31 Jan 2006 10:58:19 +0000 Received: from [59.95.1.225] (helo=titan.linsyssoft.com) by svr68.ehostpros.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52) id 1F3tDD-0000A2-9W for gdb-patches@sources.redhat.com; Tue, 31 Jan 2006 02:58:16 -0800 Received: from krypton (krypton [192.168.1.13] (may be forged)) by titan.linsyssoft.com (8.13.1/8.13.1) with ESMTP id k0VAiSvX029225 for ; Tue, 31 Jan 2006 16:14:28 +0530 Subject: Version string added to gdbserver From: Girish Shilamkar To: gdb-patches@sources.redhat.com Content-Type: multipart/mixed; boundary="=-nshQT4V73DWFF3fhJw4A" Date: Tue, 31 Jan 2006 10:58:00 -0000 Message-Id: <1138705200.3213.12.camel@krypton> Mime-Version: 1.0 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00487.txt.bz2 --=-nshQT4V73DWFF3fhJw4A Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 450 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. --=-nshQT4V73DWFF3fhJw4A Content-Disposition: attachment; filename=gdbserver_version.patch Content-Type: text/x-patch; name=gdbserver_version.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 2733 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 #include @@ -358,6 +359,8 @@ initialize_low (); + fprintf(stderr, "GNU %s\n",version); + own_buf = malloc (PBUFSIZ); mem_buf = malloc (PBUFSIZ); --=-nshQT4V73DWFF3fhJw4A--