|
From: <sv...@va...> - 2016-11-29 22:32:35
|
Author: philippe
Date: Tue Nov 29 22:32:27 2016
New Revision: 16164
Log:
352395 - Please provide SVN revision info in --version -v
Finally committed ... :)
Added:
trunk/auxprogs/make_or_upd_vgversion_h (with props)
Modified:
trunk/Makefile.am
trunk/NEWS
trunk/auxprogs/Makefile.am
trunk/coregrind/m_main.c
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Tue Nov 29 22:32:27 2016
@@ -62,7 +62,7 @@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = valgrind.pc
-BUILT_SOURCES = default.supp valgrind.pc
+BUILT_SOURCES = default.supp vgversion.h valgrind.pc
CLEANFILES = default.supp
default.supp: $(DEFAULT_SUPP_FILES)
@@ -116,10 +116,13 @@
valgrind.spec \
autogen.sh
+dist-hook: vgversion.h
+ cp -p include/vgversion.h $(distdir)/include/vgversion.h
+
dist_noinst_SCRIPTS = \
vg-in-place
-all-local: default.supp
+all-local: default.supp vgversion.h
mkdir -p $(inplacedir)
rm -f $(inplacedir)/default.supp
ln -s ../default.supp $(inplacedir)
@@ -129,3 +132,7 @@
# Need config.h in the installed tree, since some files depend on it
pkginclude_HEADERS = config.h
+
+# vgversion.h defines accurate versions to report with -v --version
+vgversion.h:
+ auxprogs/make_or_upd_vgversion_h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Nov 29 22:32:27 2016
@@ -72,6 +72,7 @@
where XXXXXX is the bug number as listed below.
348616 Wine/valgrind: noted but unhandled ioctl 0x5390 [..] (DVD_READ_STRUCT)
+352395 Please provide SVN revision info in --version -v
352767 Wine/valgrind: noted but unhandled ioctl 0x5307 [..] (CDROMSTOP)
371412 Rename wrap_sys_shmat to sys_shmat like other wrappers
371869 support '%' in symbol Z-encoding
@@ -81,7 +82,6 @@
372600 process loops forever when fatal signals are arriving quickly
373046 Stacks registered by core are never deregistered
-
Release 3.12.0 (20 October 2016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modified: trunk/auxprogs/Makefile.am
==============================================================================
--- trunk/auxprogs/Makefile.am (original)
+++ trunk/auxprogs/Makefile.am Tue Nov 29 22:32:27 2016
@@ -6,6 +6,7 @@
gen-mdg \
gsl16test \
gsl19test \
+ make_or_upd_vgversion_h \
nightly-build-summary \
update-demangler \
posixtestsuite-1.5.1-diff-results
Added: trunk/auxprogs/make_or_upd_vgversion_h
==============================================================================
--- trunk/auxprogs/make_or_upd_vgversion_h (added)
+++ trunk/auxprogs/make_or_upd_vgversion_h Tue Nov 29 22:32:27 2016
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+extract_svn_version()
+{
+ if [ -d "$1"/.svn ]
+ then
+ svnversion -n "$1"
+ elif [ -d "$1"/.git/svn ]
+ then
+ cd "$1" || exit 1
+ git svn info . | grep '^Revision' | cut -d ' ' -f2 | tr -d '\n'
+ else
+ echo "unknown"
+ fi
+}
+
+cat > include/vgversion.h.tmp <<EOF
+/* Do not edit: file generated by auxprogs/make_or_upd_vgversion_h.
+ This file defines VGSVN and VEXSVN, used to report SVN revision
+ when using command line options: -v --version
+*/
+#define VGSVN "$(extract_svn_version .)"
+#define VEXSVN "$(extract_svn_version VEX)"
+EOF
+
+if [ -f include/vgversion.h ]
+then
+ # There is already a vgversion.h.
+ # Update it only if we found a different and real svn version
+ if grep unknown include/vgversion.h.tmp ||
+ cmp -s include/vgversion.h include/vgversion.h.tmp
+ then
+ rm include/vgversion.h.tmp
+ else
+ mv include/vgversion.h.tmp include/vgversion.h
+ fi
+else
+ # There is no vgversion.h. Use the one just generated, whatever it is.
+ mv include/vgversion.h.tmp include/vgversion.h
+fi
Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Tue Nov 29 22:32:27 2016
@@ -28,6 +28,7 @@
The GNU General Public License is contained in the file COPYING.
*/
+#include "vgversion.h"
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
@@ -378,6 +379,7 @@
{
UInt i;
HChar* str;
+ Int need_version = 0;
vg_assert( VG_(args_for_valgrind) );
@@ -387,12 +389,13 @@
str = * (HChar**) VG_(indexXA)( VG_(args_for_valgrind), i );
vg_assert(str);
- // Nb: the version string goes to stdout.
- if VG_XACT_CLO(str, "--version", VG_(log_output_sink).fd, 1) {
- VG_(log_output_sink).is_socket = False;
- VG_(printf)("valgrind-" VERSION "\n");
- VG_(exit)(0);
- }
+ if VG_XACT_CLO(str, "--version", need_version, 1) {}
+ else if (VG_STREQ(str, "-v") ||
+ VG_STREQ(str, "--verbose"))
+ VG_(clo_verbosity)++;
+ else if (VG_STREQ(str, "-q") ||
+ VG_STREQ(str, "--quiet"))
+ VG_(clo_verbosity)--;
else if VG_XACT_CLO(str, "--help", *need_help, *need_help+1) {}
else if VG_XACT_CLO(str, "-h", *need_help, *need_help+1) {}
@@ -421,6 +424,17 @@
VG_(clo_sim_hints)) {}
}
+ if (need_version) {
+ // Nb: the version string goes to stdout.
+ VG_(log_output_sink).fd = 1;
+ VG_(log_output_sink).is_socket = False;
+ if (VG_(clo_verbosity) <= 1)
+ VG_(printf)("valgrind-" VERSION "\n");
+ else
+ VG_(printf)("valgrind-" VERSION "-" VGSVN "-vex-" VEXSVN "\n");
+ VG_(exit)(0);
+ }
+
/* For convenience */
VG_N_THREADS = VG_(clo_max_threads);
}
@@ -557,6 +571,10 @@
else if VG_STREQN(20, arg, "--command-line-only=") {}
else if VG_STREQ( arg, "--") {}
else if VG_STREQ( arg, "-d") {}
+ else if VG_STREQ( arg, "-q") {}
+ else if VG_STREQ( arg, "--quiet") {}
+ else if VG_STREQ( arg, "-v") {}
+ else if VG_STREQ( arg, "--verbose") {}
else if VG_STREQN(17, arg, "--max-stackframe=") {}
else if VG_STREQN(17, arg, "--main-stacksize=") {}
else if VG_STREQN(14, arg, "--max-threads=") {}
@@ -587,15 +605,8 @@
" (or --vex-iropt-register-updates=allregs-at-each-insn)\n");
}
- // These options are new.
- else if (VG_STREQ(arg, "-v") ||
- VG_STREQ(arg, "--verbose"))
- VG_(clo_verbosity)++;
-
- else if (VG_STREQ(arg, "-q") ||
- VG_STREQ(arg, "--quiet"))
- VG_(clo_verbosity)--;
-
+ /* These options are new, not yet handled by
+ early_process_cmd_line_options. */
else if VG_BOOL_CLO(arg, "--sigill-diagnostics", VG_(clo_sigill_diag))
sigill_diag_set = True;
|