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)
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)
# 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
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
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)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- /dev/null
+#!/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
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"
{
UInt i;
HChar* str;
+ Int need_version = 0;
vg_assert( VG_(args_for_valgrind) );
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) {}
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);
}
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=") {}
" (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;