aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-06-21 14:41:24 -0700
committerElliott Hughes <enh@google.com>2017-06-21 14:46:09 -0700
commited39800a83baf5bffbe391f3974eb2af0f415f80 (patch)
tree3f7ade6527142f4467725e8dfe222508bdfdfaf1 /include
parenteecc5c6bab18ffcd90421705c4a5b803058b588b (diff)
downloadvalgrind-ed39800a83baf5bffbe391f3974eb2af0f415f80.tar.gz
Upgrade to valgrind 3.13.0 (15 June 2017).
Release 3.13.0 (15 June 2017) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.13.0 is a feature release with many improvements and the usual collection of bug fixes. This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux, PPC32/Linux, PPC64BE/Linux, PPC64LE/Linux, S390X/Linux, MIPS32/Linux, MIPS64/Linux, ARM/Android, ARM64/Android, MIPS32/Android, X86/Android, X86/Solaris, AMD64/Solaris and AMD64/MacOSX 10.12. * ==================== CORE CHANGES =================== * The translation cache size has been increased to keep up with the demands of large applications. The maximum number of sectors has increased from 24 to 48. The default number of sectors has increased from 16 to 32 on all targets except Android, where the increase is from 6 to 12. * The amount of memory that Valgrind can use has been increased from 64GB to 128GB. In particular this means your application can allocate up to about 60GB when running on Memcheck. * Valgrind's default load address has been changed from 0x3800'0000 to 0x5800'0000, so as to make it possible to load larger executables. This should make it possible to load executables of size at least 1200MB. * A massive spaceleak caused by reading compressed debuginfo files has been fixed. Valgrind should now be entirely usable with gcc-7.0 "-gz" created debuginfo. * The C++ demangler has been updated. * Support for demangling Rust symbols has been added. * A new representation of stack traces, the "XTree", has been added. An XTree is a tree of stacktraces with data associated with the stacktraces. This is used by various tools (Memcheck, Helgrind, Massif) to report on the heap consumption of your program. Reporting is controlled by the new options --xtree-memory=none|allocs|full and --xtree-memory-file=<file>. A report can also be produced on demand using the gdbserver monitor command 'xtmemory [<filename>]>'. The XTree can be output in 2 formats: 'callgrind format' and 'massif format. The existing visualisers for these formats (e.g. callgrind_annotate, KCachegrind, ms_print) can be used to visualise and analyse these reports. Memcheck can also produce XTree leak reports using the Callgrind file format. For more details, see the user manual. * ================== PLATFORM CHANGES ================= * ppc64: support for ISA 3.0B and various fixes for existing 3.0 support * amd64: fixes for JIT failure problems on long AVX2 code blocks * amd64 and x86: support for CET prefixes has been added * arm32: a few missing ARMv8 instructions have been implemented * arm64, mips64, mips32: an alternative implementation of Load-Linked and Store-Conditional instructions has been added. This is to deal with processor implementations that implement the LL/SC specifications strictly and as a result cause Valgrind to hang in certain situations. The alternative implementation is automatically enabled at startup, as required. You can use the option --sim-hints=fallback-llsc to force-enable it if you want. * Support for OSX 10.12 has been improved. * On Linux, clone handling has been improved to honour CLONE_VFORK that involves a child stack. Note however that CLONE_VFORK | CLONE_VM is handled like CLONE_VFORK (by removing CLONE_VM), so applications that depend on CLONE_VM exact semantics will (still) not work. * The TileGX/Linux port has been removed because it appears to be both unused and unsupported. * ==================== TOOL CHANGES ==================== * Memcheck: - Memcheck should give fewer false positives when running optimised Clang/LLVM generated code. - Support for --xtree-memory and 'xtmemory [<filename>]>'. - New command line options --xtree-leak=no|yes and --xtree-leak-file=<file> to produce the end of execution leak report in a xtree callgrind format file. - New option 'xtleak' in the memcheck leak_check monitor command, to produce the leak report in an xtree file. * Massif: - Support for --xtree-memory and 'xtmemory [<filename>]>'. - For some workloads (typically, for big applications), Massif memory consumption and CPU consumption has decreased significantly. * Helgrind: - Support for --xtree-memory and 'xtmemory [<filename>]>'. - addition of client request VALGRIND_HG_GNAT_DEPENDENT_MASTER_JOIN, useful for Ada gnat compiled applications. * ==================== OTHER CHANGES ==================== * For Valgrind developers: in an outer/inner setup, the outer Valgrind will append the inner guest stacktrace to the inner host stacktrace. This helps to investigate the errors reported by the outer, when they are caused by the inner guest program (such as an inner regtest). See README_DEVELOPERS for more info. * To allow fast detection of callgrind files by desktop environments and file managers, the format was extended to have an optional first line that uniquely identifies the format ("# callgrind format"). Callgrind creates this line now, as does the new xtree functionality. * File name template arguments (such as --log-file, --xtree-memory-file, ...) have a new %n format letter that is replaced by a sequence number. * "--version -v" now shows the SVN revision numbers from which Valgrind was built. * ==================== FIXED BUGS ==================== The following bugs have been fixed or resolved. Note that "n-i-bz" stands for "not in bugzilla" -- that is, a bug that was reported to us but never got a bugzilla entry. We encourage you to file bugs in bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX where XXXXXX is the bug number as listed below. 162848 --log-file output isn't split when a program forks 340777 Illegal instruction on mips (ar71xx) 341481 MIPS64: Iop_CmpNE32 triggers false warning on MIPS64 platforms 342040 Valgrind mishandles clone with CLONE_VFORK | CLONE_VM that clones to a different stack. 344139 x86 stack-seg overrides, needed by the Wine people 344524 store conditional of guest applications always fail - observed on Octeon3(MIPS) 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) 356374 Assertion 'DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID' failed 358213 helgrind/drd bar_bad testcase hangs or crashes with new glibc pthread barrier implementation 358697 valgrind.h: Some code remains even when defining NVALGRIND 359202 Add musl libc configure/compile 360415 amd64 instructions ADCX and ADOX are not implemented in VEX == 372828 (vex amd64->IR: 0x66 0xF 0x3A 0x62 0x4A 0x10) 360429 unhandled ioctl 0x530d with no size/direction hints (CDROMREADMODE1) 362223 assertion failed when .valgrindrc is a directory instead of a file 367543 bt/btc/btr/bts x86/x86_64 instructions are poorly-handled wrt flags 367942 Segfault vgPlain_do_sys_sigaction (m_signals.c:1138) 368507 can't malloc chunks larger than about 34GB 368529 Android arm target link error, missing atexit and pthread_atfork 368863 WARNING: unhandled arm64-linux syscall: 100 (get_robust_list) 368865 WARNING: unhandled arm64-linux syscall: 272 (kcmp) 368868 disInstr(arm64): unhandled instruction 0xD53BE000 = cntfrq_el0 (ARMv8) 368917 WARNING: unhandled arm64-linux syscall: 218 (request_key) 368918 WARNING: unhandled arm64-linux syscall: 127 (sched_rr_get_interval) 368922 WARNING: unhandled arm64-linux syscall: 161 (sethostname) 368924 WARNING: unhandled arm64-linux syscall: 84 (sync_file_range) 368925 WARNING: unhandled arm64-linux syscall: 130 (tkill) 368926 WARNING: unhandled arm64-linux syscall: 97 (unshare) 369459 valgrind on arm64 violates the ARMv8 spec (ldxr/stxr) 370028 Reduce the number of compiler warnings on MIPS platforms 370635 arm64 missing syscall getcpu 371225 Fix order of timer_{gettime,getoverrun,settime} syscalls on arm64 371227 Clean AArch64 syscall table 371412 Rename wrap_sys_shmat to sys_shmat like other wrappers 371471 Valgrind complains about non legit memory leaks on placement new (C++) 371491 handleAddrOverrides() is [incorrect] when ASO prefix is used 371503 disInstr(arm64): unhandled instruction 0xF89F0000 371869 support '%' in symbol Z-encoding 371916 execution tree xtree concept 372120 c++ demangler demangles symbols which are not c++ 372185 Support of valgrind on ARMv8 with 32 bit executable 372188 vex amd64->IR: 0x66 0xF 0x3A 0x62 0x4A 0x10 0x10 0x48 (PCMPxSTRx $0x10) 372195 Power PC, xxsel instruction is not always recognized. 372504 Hanging on exit_group 372600 process loops forever when fatal signals are arriving quickly 372794 LibVEX (arm32 front end): 'Assertion szBlg2 <= 3' failed 373046 Stacks registered by core are never deregistered 373069 memcheck/tests/leak_cpp_interior fails with GCC 5.1+ 373086 Implement additional Xen hypercalls 373192 Calling posix_spawn in glibc 2.24 completely broken 373488 Support for fanotify API on ARM64 architecture == 368864 WARNING: unhandled arm64-linux syscall: 262 (fanotify_init) 373555 Rename BBPTR to GSPTR as it denotes guest state pointer only 373938 const IRExpr arguments for matchIRExpr() 374719 some spelling fixes 374963 increase valgrind's load address to prevent mmap failure 375514 valgrind_get_tls_addr() does not work in case of static TLS 375772 +1 error in get_elf_symbol_info() when computing value of 'hi' address for ML_(find_rx_mapping)() 375806 Test helgrind/tests/tc22_exit_w_lock fails with glibc 2.24 375839 Temporary storage exhausted, with long sequence of vfmadd231ps insns == 377159 "vex: the `impossible' happened" still present == 375150 Assertion 'tres.status == VexTransOK' failed == 378068 valgrind crashes on AVX2 function in FFmpeg 376142 Segfaults on MIPS Cavium Octeon boards 376279 disInstr(arm64): unhandled instruction 0xD50320FF 376455 Solaris: unhandled syscall lgrpsys(180) 376518 Solaris: unhandled fast trap getlgrp(6) 376611 ppc64 and arm64 don't know about prlimit64 syscall 376729 PPC64, remove R2 from the clobber list == 371668 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION causing some addresses to be wrongly marked as addressable 377066 Some Valgrind unit tests fail to compile on Ubuntu 16.10 with PIE enabled by default 377376 memcheck/tests/linux/getregset fails with glibc2.24 377427 PPC64, lxv instruction failing on odd destination register 377478 PPC64: ISA 3.0 setup fixes 377698 Missing memory check for futex() uaddr arg for FUTEX_WAKE and FUTEX_WAKE_BITSET, check only 4 args for FUTEX_WAKE_BITSET, and 2 args for FUTEX_TRYLOCK_PI 377717 Fix massive space leak when reading compressed debuginfo sections 377891 Update Xen 4.6 domctl wrappers 377930 fcntl syscall wrapper is missing flock structure check 378524 libvexmultiarch_test regression on s390x and ppc64 378535 Valgrind reports INTERNAL ERROR in execve syscall wrapper 378673 Update libiberty demangler 378931 Add ISA 3.0B additional isnstructions, add OV32, CA32 setting support 379039 syscall wrapper for prctl(PR_SET_NAME) must not check more than 16 bytes 379094 Valgrind reports INTERNAL ERROR in rt_sigsuspend syscall wrapper 379371 UNKNOWN task message [id 3444, to mach_task_self(), reply 0x603] (task_register_dyld_image_infos) 379372 UNKNOWN task message [id 3447, to mach_task_self(), reply 0x603] (task_register_dyld_shared_cache_image_info) 379390 unhandled syscall: mach:70 (host_create_mach_voucher_trap) 379473 MIPS: add support for rdhwr cycle counter register 379504 remove TileGX/Linux port 379525 Support more x86 nop opcodes 379838 disAMode(x86): not an addr! 379703 PC ISA 3.0 fixes: stxvx, stxv, xscmpexpdp instructions 379890 arm: unhandled instruction: 0xEBAD 0x1B05 (sub.w fp, sp, r5, lsl #4) 379895 clock_gettime does not execute POST syscall wrapper 379925 PPC64, mtffs does not set the FPCC and C bits in the FPSCR correctly 379966 WARNING: unhandled amd64-linux syscall: 313 (finit_module) 380200 xtree generated callgrind files refer to files without directory name 380202 Assertion failure for cache line size (cls == 64) on aarch64. 380397 s390x: __GI_strcspn() replacement needed n-i-bz Fix pub_tool_basics.h build issue with g++ 4.4.7. (3.13.0.RC1: 2 June 2017, vex r3386, valgrind r16434) (3.13.0.RC2: 9 June 2017, vex r3389, valgrind r16443) (3.13.0: 14 June 2017, vex r3396, valgrind r16446) Bug: N/A Test: manual Change-Id: Id4498a49f462c3689cbcb35c15f96a8c7e3cea17
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am2
-rw-r--r--include/Makefile.in3
-rw-r--r--include/pub_tool_addrinfo.h4
-rw-r--r--include/pub_tool_aspacehl.h2
-rw-r--r--include/pub_tool_aspacemgr.h2
-rw-r--r--include/pub_tool_basics.h39
-rw-r--r--include/pub_tool_basics_asm.h2
-rw-r--r--include/pub_tool_clientstate.h2
-rw-r--r--include/pub_tool_clreq.h2
-rw-r--r--include/pub_tool_debuginfo.h55
-rw-r--r--include/pub_tool_deduppoolalloc.h49
-rw-r--r--include/pub_tool_errormgr.h2
-rw-r--r--include/pub_tool_execontext.h2
-rw-r--r--include/pub_tool_gdbserver.h2
-rw-r--r--include/pub_tool_guest.h5
-rw-r--r--include/pub_tool_hashtable.h2
-rw-r--r--include/pub_tool_libcassert.h2
-rw-r--r--include/pub_tool_libcbase.h4
-rw-r--r--include/pub_tool_libcfile.h2
-rw-r--r--include/pub_tool_libcprint.h2
-rw-r--r--include/pub_tool_libcproc.h2
-rw-r--r--include/pub_tool_libcsetjmp.h12
-rw-r--r--include/pub_tool_libcsignal.h2
-rw-r--r--include/pub_tool_machine.h8
-rw-r--r--include/pub_tool_mallocfree.h2
-rw-r--r--include/pub_tool_options.h22
-rw-r--r--include/pub_tool_oset.h21
-rw-r--r--include/pub_tool_poolalloc.h6
-rw-r--r--include/pub_tool_rangemap.h6
-rw-r--r--include/pub_tool_redir.h14
-rw-r--r--include/pub_tool_replacemalloc.h2
-rw-r--r--include/pub_tool_seqmatch.h2
-rw-r--r--include/pub_tool_signals.h2
-rw-r--r--include/pub_tool_sparsewa.h2
-rw-r--r--include/pub_tool_stacktrace.h4
-rw-r--r--include/pub_tool_threadstate.h2
-rw-r--r--include/pub_tool_tooliface.h2
-rw-r--r--include/pub_tool_transtab.h2
-rw-r--r--include/pub_tool_vki.h6
-rw-r--r--include/pub_tool_vkiscnums.h4
-rw-r--r--include/pub_tool_vkiscnums_asm.h7
-rw-r--r--include/pub_tool_wordfm.h4
-rw-r--r--include/pub_tool_xarray.h8
-rw-r--r--include/pub_tool_xtmemory.h86
-rw-r--r--include/pub_tool_xtree.h248
-rw-r--r--include/valgrind.h556
-rw-r--r--include/vgversion.h6
-rw-r--r--include/vgversion_dist.h6
-rw-r--r--include/vki/vki-amd64-linux.h2
-rw-r--r--include/vki/vki-arm-linux.h2
-rw-r--r--include/vki/vki-arm64-linux.h5
-rw-r--r--include/vki/vki-darwin.h2
-rw-r--r--include/vki/vki-linux.h38
-rw-r--r--include/vki/vki-mips32-linux.h4
-rw-r--r--include/vki/vki-mips64-linux.h3
-rw-r--r--include/vki/vki-posixtypes-amd64-linux.h2
-rw-r--r--include/vki/vki-posixtypes-arm-linux.h2
-rw-r--r--include/vki/vki-posixtypes-arm64-linux.h2
-rw-r--r--include/vki/vki-posixtypes-mips32-linux.h2
-rw-r--r--include/vki/vki-posixtypes-mips64-linux.h2
-rw-r--r--include/vki/vki-posixtypes-ppc32-linux.h2
-rw-r--r--include/vki/vki-posixtypes-ppc64-linux.h2
-rw-r--r--include/vki/vki-posixtypes-s390x-linux.h2
-rw-r--r--include/vki/vki-posixtypes-x86-linux.h2
-rw-r--r--include/vki/vki-ppc32-linux.h5
-rw-r--r--include/vki/vki-ppc64-linux.h5
-rw-r--r--include/vki/vki-s390x-linux.h4
-rw-r--r--include/vki/vki-scnums-amd64-linux.h2
-rw-r--r--include/vki/vki-scnums-arm-linux.h2
-rw-r--r--include/vki/vki-scnums-arm64-linux.h2
-rw-r--r--include/vki/vki-scnums-darwin.h77
-rw-r--r--include/vki/vki-scnums-mips32-linux.h2
-rw-r--r--include/vki/vki-scnums-mips64-linux.h2
-rw-r--r--include/vki/vki-scnums-ppc32-linux.h2
-rw-r--r--include/vki/vki-scnums-ppc64-linux.h2
-rw-r--r--include/vki/vki-scnums-s390x-linux.h2
-rw-r--r--include/vki/vki-scnums-solaris.h13
-rw-r--r--include/vki/vki-scnums-x86-linux.h2
-rw-r--r--include/vki/vki-solaris-repcache.h6
-rw-r--r--include/vki/vki-solaris.h30
-rw-r--r--include/vki/vki-x86-linux.h2
-rw-r--r--include/vki/vki-xen-domctl.h132
-rw-r--r--include/vki/vki-xen-evtchn.h2
-rw-r--r--include/vki/vki-xen-gnttab.h2
-rw-r--r--include/vki/vki-xen-hvm.h2
-rw-r--r--include/vki/vki-xen-memory.h2
-rw-r--r--include/vki/vki-xen-mmuext.h2
-rw-r--r--include/vki/vki-xen-physdev.h2
-rw-r--r--include/vki/vki-xen-schedop.h2
-rw-r--r--include/vki/vki-xen-tmem.h2
-rw-r--r--include/vki/vki-xen-version.h2
-rw-r--r--include/vki/vki-xen-x86.h15
-rw-r--r--include/vki/vki-xen-xsm.h2
-rw-r--r--include/vki/vki-xen.h2
94 files changed, 880 insertions, 752 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index ccfcd2778..11c7ca86d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -43,6 +43,8 @@ nobase_pkginclude_HEADERS = \
pub_tool_vkiscnums_asm.h \
pub_tool_wordfm.h \
pub_tool_xarray.h \
+ pub_tool_xtree.h \
+ pub_tool_xtmemory.h \
valgrind.h \
vki/vki-linux.h \
vki/vki-darwin.h \
diff --git a/include/Makefile.in b/include/Makefile.in
index 687ab2f92..38c483ef7 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -212,6 +212,7 @@ FLAG_MLONG_DOUBLE_128 = @FLAG_MLONG_DOUBLE_128@
FLAG_MMMX = @FLAG_MMMX@
FLAG_MSSE = @FLAG_MSSE@
FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
+FLAG_NO_PIE = @FLAG_NO_PIE@
FLAG_OCTEON = @FLAG_OCTEON@
FLAG_OCTEON2 = @FLAG_OCTEON2@
FLAG_T_TEXT = @FLAG_T_TEXT@
@@ -386,6 +387,8 @@ nobase_pkginclude_HEADERS = \
pub_tool_vkiscnums_asm.h \
pub_tool_wordfm.h \
pub_tool_xarray.h \
+ pub_tool_xtree.h \
+ pub_tool_xtmemory.h \
valgrind.h \
vki/vki-linux.h \
vki/vki-darwin.h \
diff --git a/include/pub_tool_addrinfo.h b/include/pub_tool_addrinfo.h
index 5dc66cd6d..580887837 100644
--- a/include/pub_tool_addrinfo.h
+++ b/include/pub_tool_addrinfo.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -145,7 +145,7 @@ struct _AddrInfo {
// blocks and Arena blocks.
// alloc_tinfo identifies the thread that has allocated the block.
// This is used by tools such as helgrind that maintain
- // more detailed informations about client blocks.
+ // more detailed information about client blocks.
struct {
BlockKind block_kind;
const HChar* block_desc; // "block","mempool","user-defined",arena
diff --git a/include/pub_tool_aspacehl.h b/include/pub_tool_aspacehl.h
index 421036789..fd523ca92 100644
--- a/include/pub_tool_aspacehl.h
+++ b/include/pub_tool_aspacehl.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2009-2015 Julian Seward
+ Copyright (C) 2009-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_aspacemgr.h b/include/pub_tool_aspacemgr.h
index 4a83e357d..5ea671d64 100644
--- a/include/pub_tool_aspacemgr.h
+++ b/include/pub_tool_aspacemgr.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_basics.h b/include/pub_tool_basics.h
index 810e27ec8..e3af28339 100644
--- a/include/pub_tool_basics.h
+++ b/include/pub_tool_basics.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -129,6 +129,17 @@ typedef struct { UWord uw1; UWord uw2; } UWordPair;
/* ThreadIds are simply indices into the VG_(threads)[] array. */
typedef UInt ThreadId;
+/* Many data structures need to allocate and release memory.
+ The allocation/release functions must be provided by the caller.
+ The Alloc_Fn_t function must allocate a chunk of memory of size szB.
+ cc is the Cost Centre for this allocated memory. This constant string
+ is used to provide Valgrind's heap profiling, activated by
+ --profile-heap=no|yes.
+ The corresponding Free_Fn_t frees the memory chunk p. */
+
+typedef void* (*Alloc_Fn_t) ( const HChar* cc, SizeT szB );
+typedef void (*Free_Fn_t) ( void* p );
+
/* An abstraction of syscall return values.
Linux/MIPS32 and Linux/MIPS64:
When _isError == False,
@@ -231,7 +242,7 @@ static inline UWord sr_Err ( SysRes sr ) {
}
static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
/* This uglyness of hardcoding syscall numbers is necessary to
- avoid having this header file be dependant on
+ avoid having this header file be dependent on
include/vki/vki-scnums-mips{32,64}-linux.h. It seems pretty
safe given that it is inconceivable that the syscall numbers
for such simple syscalls would ever change. To make it
@@ -348,8 +359,8 @@ static inline UWord sr_Err ( SysRes sr ) {
static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
/* sysno is ignored for Solaris */
return sr1._val == sr2._val
- && sr1._val2 == sr2._val2
- && sr1._isError == sr2._isError;
+ && sr1._isError == sr2._isError
+ && (!sr1._isError) ? (sr1._val2 == sr2._val2) : True;
}
#else
@@ -371,7 +382,7 @@ static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
#if defined(VGA_x86) || defined(VGA_amd64) || defined (VGA_arm) \
|| ((defined(VGA_mips32) || defined(VGA_mips64)) && defined (_MIPSEL)) \
- || defined(VGA_arm64) || defined(VGA_ppc64le) || defined(VGA_tilegx)
+ || defined(VGA_arm64) || defined(VGA_ppc64le)
# define VG_LITTLEENDIAN 1
#elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_s390x) \
|| ((defined(VGA_mips32) || defined(VGA_mips64)) && defined (_MIPSEB))
@@ -385,6 +396,10 @@ static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
# define offsetof(type,memb) ((SizeT)(HWord)&((type*)0)->memb)
#endif
+#if !defined(container_of)
+# define container_of(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member)))
+#endif
+
/* Alignment */
/* We use a prefix vg_ for vg_alignof as its behaviour slightly
differs from the standard alignof/gcc defined __alignof__
@@ -414,7 +429,7 @@ static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
|| defined(VGA_ppc64be) || defined(VGA_ppc64le) \
|| defined(VGA_arm) || defined(VGA_s390x) \
|| defined(VGA_mips32) || defined(VGA_mips64) \
- || defined(VGA_arm64) || defined(VGA_tilegx)
+ || defined(VGA_arm64)
# define VG_REGPARM(n) /* */
#else
# error Unknown arch
@@ -457,6 +472,18 @@ static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
} var = { .in = x }; var.out; \
})
+/* Some architectures (eg. mips, arm) do not support unaligned memory access
+ by hardware, so GCC warns about suspicious situations. This macro could
+ be used to avoid these warnings but only after careful examination. */
+#define ASSUME_ALIGNED(D, x) \
+ ({ \
+ union { \
+ void *in; \
+ D out; \
+ } var; \
+ var.in = (void *) (x); var.out; \
+ })
+
// Poor man's static assert
#define STATIC_ASSERT(x) extern int VG_(VG_(VG_(unused)))[(x) ? 1 : -1] \
__attribute__((unused))
diff --git a/include/pub_tool_basics_asm.h b/include/pub_tool_basics_asm.h
index d73c91e93..a2f105641 100644
--- a/include/pub_tool_basics_asm.h
+++ b/include/pub_tool_basics_asm.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_clientstate.h b/include/pub_tool_clientstate.h
index af0fbbf4b..d1b764eb0 100644
--- a/include/pub_tool_clientstate.h
+++ b/include/pub_tool_clientstate.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_clreq.h b/include/pub_tool_clreq.h
index b3798e0ac..37af2ced0 100644
--- a/include/pub_tool_clreq.h
+++ b/include/pub_tool_clreq.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_debuginfo.h b/include/pub_tool_debuginfo.h
index 49ceffbdf..6250e1bf1 100644
--- a/include/pub_tool_debuginfo.h
+++ b/include/pub_tool_debuginfo.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -38,12 +38,44 @@
/*=== Obtaining debug information ===*/
/*====================================================================*/
+/* IMPORTANT COMMENT about memory persistence and ownership.
+
+ Many functions below are returning a string in a HChar** argument.
+ This memory must not be freed by the caller : it belongs to the debuginfo
+ module. The returned string is *not* guaranteed to be persistent.
+ The exact persistence depends on the kind of information returned,
+ and of the internal implementation of the debuginfo module.
+ In other words: use the memory directly after the call, and if in doubt,
+ save it away.
+
+ In general, all returned strings will be invalidated when the
+ DebugInfo they correspond to is discarded. This is the case for
+ the filename, dirname, fnname and objname.
+ An objname might also be invalidated by changes to the address
+ space manager segments, e.g. if a segment is merged with another
+ segment.
+
+ Retrieving a fnname might imply a call to the c++ demangler.
+ A returned fnname is invalidated if any other call to the demangler
+ is done. In particular, this means that the memory returned by one of
+ the VG_(get_fnname...) functions is invalidated by :
+ * another call to any of the functions VG_(get_fnname...).
+ * any other call that will directly or indirectly invoke the
+ c++ demangler. Such an indirect call to the demangler can a.o. be
+ done by calls to pub_tool_errormgr.h functions.
+ So, among others, the following is WRONG:
+ VG_(get_fnname)(a1, &fnname1);
+ VG_(get_fnname)(a2, &fnname2);
+ ... it is WRONG to use fnname1 here ....
+*/
+
/* Get the file/function/line number of the instruction at address
'a'. For these four, if debug info for the address is found, it
copies the info into the buffer/UInt and returns True. If not, it
returns False. VG_(get_fnname) always
demangles C++ function names. VG_(get_fnname_w_offset) is the
- same, except it appends "+N" to symbol names to indicate offsets. */
+ same, except it appends "+N" to symbol names to indicate offsets.
+ NOTE: See IMPORTANT COMMENT above about persistence and ownership. */
extern Bool VG_(get_filename) ( Addr a, const HChar** filename );
extern Bool VG_(get_fnname) ( Addr a, const HChar** fnname );
extern Bool VG_(get_linenum) ( Addr a, UInt* linenum );
@@ -58,9 +90,7 @@ extern Bool VG_(get_fnname_w_offset)
it is available; if not available, '\0' is written to the first
byte.
- The character strings returned in *filename and *dirname are not
- persistent. They will be freed when the DebugInfo they belong to
- is discarded.
+ NOTE: See IMPORTANT COMMENT above about persistence and ownership.
Returned value indicates whether any filename/line info could be
found. */
@@ -76,7 +106,8 @@ extern Bool VG_(get_filename_linenum)
instruction in a function. Use this to instrument the start of
a particular function. Nb: if an executable/shared object is stripped
of its symbols, this function will not be able to recognise function
- entry points within it. */
+ entry points within it.
+ NOTE: See IMPORTANT COMMENT above about persistence and ownership. */
extern Bool VG_(get_fnname_if_entry) ( Addr a, const HChar** fnname );
typedef
@@ -120,7 +151,9 @@ Bool VG_(get_data_description)(
);
/* Succeeds if the address is within a shared object or the main executable.
- It doesn't matter if debug info is present or not. */
+ It first searches if Addr a belongs to the text segment of debug info.
+ If not found, it asks the address space manager whether it
+ knows the name of the file associated with this mapping. */
extern Bool VG_(get_objname) ( Addr a, const HChar** objname );
@@ -261,10 +294,10 @@ typedef
const HChar* VG_(pp_SectKind)( VgSectKind kind );
/* Given an address 'a', make a guess of which section of which object
- it comes from. If name is non-NULL, then the object's name is put
- into *name. The returned name is persistent as long as the debuginfo
- it belongs to isn't discarded. */
-VgSectKind VG_(DebugInfo_sect_kind)( /*OUT*/const HChar** name, Addr a);
+ it comes from. If objname is non-NULL, then the object's name is put
+ into *objname. This only looks in debug info, it does not examine
+ the address space manager mapped files. */
+VgSectKind VG_(DebugInfo_sect_kind)( /*OUT*/const HChar** objname, Addr a);
#endif // __PUB_TOOL_DEBUGINFO_H
diff --git a/include/pub_tool_deduppoolalloc.h b/include/pub_tool_deduppoolalloc.h
index a4c1a098c..e9eced834 100644
--- a/include/pub_tool_deduppoolalloc.h
+++ b/include/pub_tool_deduppoolalloc.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2014-2015 Philippe Waroquiers philippe.waroquiers@skynet.be
+ Copyright (C) 2014-2017 Philippe Waroquiers philippe.waroquiers@skynet.be
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -44,8 +44,8 @@
// individually.
// Once allocated, an element must not be modified anymore.
//
-// Elements can be inserted in the pool using VG_(allocEltDedupPA)
-// or using VG_(allocFixedEltDedupPA).
+// Elements can be inserted in the pool using VG_(allocEltDedupPA),
+// VG_(allocFixedEltDedupPA) or VG_(allocStrDedupPA).
//
// Use VG_(allocFixedEltDedupPA) to allocate elements that are all of
// the same size and that you want to identify with a (small) number:
@@ -65,6 +65,10 @@
// The address of an element allocated with VG_(allocEltDedupPA) does
// not change, even if new elements are inserted in the pool.
//
+// Use VG_(allocStrDedupPA) to create a pool of strings (in other words, a
+// dictionnary of strings). Similarly to VG_(allocFixedEltDedupPA), strings
+// inserted in a dedup pool can be identified by an element number.
+//
// In the same pool, you can only use one of the allocate element functions.
//
// A dedup pool allocator has significantly less memory overhead than
@@ -89,33 +93,46 @@ typedef struct _DedupPoolAlloc DedupPoolAlloc;
This function never returns NULL. */
extern DedupPoolAlloc* VG_(newDedupPA) ( SizeT poolSzB,
SizeT eltAlign,
- void* (*alloc)(const HChar*, SizeT),
+ Alloc_Fn_t alloc_fn,
const HChar* cc,
- void (*free_fn)(void*) );
+ Free_Fn_t free_fn );
-/* Allocates a new element from ddpa with eltSzB bytes to store elt.
+/* Allocates or retrieve element from ddpa with eltSzB bytes to store elt.
This function never returns NULL.
If ddpa already contains an element equal to elt, then the address of
the already existing element is returned.
Equality between elements is done by comparing all bytes.
So, if void *elt points to a struct, be sure to initialise all components
and the holes between components. */
-extern const void* VG_(allocEltDedupPA) (DedupPoolAlloc *ddpa,
- SizeT eltSzB, const void *elt);
+extern const void* VG_(allocEltDedupPA) (DedupPoolAlloc* ddpa,
+ SizeT eltSzB, const void* elt);
-/* Allocates a new (fixed size) element from ddpa. Returns the
- unique number identifying this element. This function never returns NULL.
+/* Allocates or retrieve a (fixed size) element from ddpa. Returns the
+ unique number identifying this element.
Similarly to VG_(allocEltDedupPA), this will return the unique number
of an already existing identical element to elt. */
-extern UInt VG_(allocFixedEltDedupPA) (DedupPoolAlloc *ddpa,
- SizeT eltSzB, const void *elt);
+extern UInt VG_(allocFixedEltDedupPA) (DedupPoolAlloc* ddpa,
+ SizeT eltSzB, const void* elt);
/* Translate an element number to its address. Note that the address
corresponding to eltNr can change if new elements are inserted
in the pool. */
-extern void* VG_(indexEltNumber) (DedupPoolAlloc *ddpa,
+extern void* VG_(indexEltNumber) (DedupPoolAlloc* ddpa,
UInt eltNr);
+/* Allocates or retrieve a string element from ddpa. Returns the
+ unique number identifying this string.
+ newStr is set to True if the str is a newly inserted string, False
+ if the str was already present in the pool.
+ Similarly to VG_(allocEltDedupPA), this will return the unique number
+ of an already existing identical string. */
+extern UInt VG_(allocStrDedupPA) (DedupPoolAlloc *ddpa,
+ const HChar* str,
+ Bool* newStr);
+/* Note: Implementing a function to return the string value from its strNr
+ implies some overhead, so will be done only if/when needed. */
+
+
/* The Dedup Pool Allocator must maintain a data structure to avoid
duplicates as long as new elements can be allocated from the pool.
Once no new elements will be allocated, this dedup data structure
@@ -123,14 +140,14 @@ extern void* VG_(indexEltNumber) (DedupPoolAlloc *ddpa,
it is an error to call VG_(allocEltDedupPA) or VG_(allocFixedEltDedupPA).
If shrink_block is not NULL, the last pool will be shrunk using
shrink_block. */
-extern void VG_(freezeDedupPA) (DedupPoolAlloc *ddpa,
+extern void VG_(freezeDedupPA) (DedupPoolAlloc* ddpa,
void (*shrink_block)(void*, SizeT));
/* How many (unique) elements are there in this ddpa now? */
-extern UInt VG_(sizeDedupPA) (DedupPoolAlloc *ddpa);
+extern UInt VG_(sizeDedupPA) (DedupPoolAlloc* ddpa);
/* Free all memory associated with a DedupPoolAlloc. */
-extern void VG_(deleteDedupPA) ( DedupPoolAlloc *ddpa);
+extern void VG_(deleteDedupPA) ( DedupPoolAlloc* ddpa);
#endif // __PUB_TOOL_DEDUPPOOLALLOC_
diff --git a/include/pub_tool_errormgr.h b/include/pub_tool_errormgr.h
index 1b9fdfe28..7af6783f1 100644
--- a/include/pub_tool_errormgr.h
+++ b/include/pub_tool_errormgr.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_execontext.h b/include/pub_tool_execontext.h
index 9ce3a2440..98419629f 100644
--- a/include/pub_tool_execontext.h
+++ b/include/pub_tool_execontext.h
@@ -6,7 +6,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_gdbserver.h b/include/pub_tool_gdbserver.h
index d4c826ba3..061c5944a 100644
--- a/include/pub_tool_gdbserver.h
+++ b/include/pub_tool_gdbserver.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2011-2015 Philippe Waroquiers
+ Copyright (C) 2011-2017 Philippe Waroquiers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/pub_tool_guest.h b/include/pub_tool_guest.h
index 2178aca33..b28e4ec4d 100644
--- a/include/pub_tool_guest.h
+++ b/include/pub_tool_guest.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2014-2015 OpenWorks LLP
+ Copyright (C) 2014-2017 OpenWorks LLP
info@open-works.net
This program is free software; you can redistribute it and/or
@@ -64,9 +64,6 @@
#elif defined(VGA_mips64)
# include "libvex_guest_mips64.h"
typedef VexGuestMIPS64State VexGuestArchState;
-#elif defined(VGA_tilegx)
-# include "libvex_guest_tilegx.h"
- typedef VexGuestTILEGXState VexGuestArchState;
#else
# error Unknown arch
#endif
diff --git a/include/pub_tool_hashtable.h b/include/pub_tool_hashtable.h
index a6cbe1cc3..22673675a 100644
--- a/include/pub_tool_hashtable.h
+++ b/include/pub_tool_hashtable.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Nicholas Nethercote
+ Copyright (C) 2005-2017 Nicholas Nethercote
njn@valgrind.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_libcassert.h b/include/pub_tool_libcassert.h
index b606d00bb..1b9dd7f58 100644
--- a/include/pub_tool_libcassert.h
+++ b/include/pub_tool_libcassert.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_libcbase.h b/include/pub_tool_libcbase.h
index 34331730e..f68579a8f 100644
--- a/include/pub_tool_libcbase.h
+++ b/include/pub_tool_libcbase.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -80,11 +80,13 @@ extern double VG_(strtod) ( const HChar* str, HChar** endptr );
&& VG_(strncmp)((s1),(s2),(n))==0) ? True : False )
extern SizeT VG_(strlen) ( const HChar* str );
+extern SizeT VG_(strnlen) ( const HChar* str, SizeT n );
extern HChar* VG_(strcat) ( HChar* dest, const HChar* src );
extern HChar* VG_(strncat) ( HChar* dest, const HChar* src, SizeT n );
extern HChar* VG_(strpbrk) ( const HChar* s, const HChar* accpt );
extern HChar* VG_(strcpy) ( HChar* dest, const HChar* src );
extern HChar* VG_(strncpy) ( HChar* dest, const HChar* src, SizeT ndest );
+extern SizeT VG_(strlcpy) ( HChar* dest, const HChar* src, SizeT n );
extern Int VG_(strcmp) ( const HChar* s1, const HChar* s2 );
extern Int VG_(strcasecmp) ( const HChar* s1, const HChar* s2 );
extern Int VG_(strncmp) ( const HChar* s1, const HChar* s2, SizeT nmax );
diff --git a/include/pub_tool_libcfile.h b/include/pub_tool_libcfile.h
index c126e1d9d..c03842a0e 100644
--- a/include/pub_tool_libcfile.h
+++ b/include/pub_tool_libcfile.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_libcprint.h b/include/pub_tool_libcprint.h
index bda41c247..fe7462880 100644
--- a/include/pub_tool_libcprint.h
+++ b/include/pub_tool_libcprint.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_libcproc.h b/include/pub_tool_libcproc.h
index cc1f9a87c..a3a186bc6 100644
--- a/include/pub_tool_libcproc.h
+++ b/include/pub_tool_libcproc.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_libcsetjmp.h b/include/pub_tool_libcsetjmp.h
index 61f897b7c..d6c6b9859 100644
--- a/include/pub_tool_libcsetjmp.h
+++ b/include/pub_tool_libcsetjmp.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2010-2015 Mozilla Inc
+ Copyright (C) 2010-2017 Mozilla Inc
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -114,7 +114,15 @@ void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
#elif defined(VGP_mips32_linux)
-#define VG_MINIMAL_JMP_BUF(_name) UInt _name [8+1+1+1+1]
+#define VG_MINIMAL_JMP_BUF(_name) ULong _name [104 / sizeof(ULong)]
+__attribute__((returns_twice))
+UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
+__attribute__((noreturn))
+void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+
+#elif defined(VGP_mips64_linux)
+
+#define VG_MINIMAL_JMP_BUF(_name) ULong _name [168 / sizeof(ULong)]
__attribute__((returns_twice))
UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
__attribute__((noreturn))
diff --git a/include/pub_tool_libcsignal.h b/include/pub_tool_libcsignal.h
index 88770d830..82d3082d6 100644
--- a/include/pub_tool_libcsignal.h
+++ b/include/pub_tool_libcsignal.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_machine.h b/include/pub_tool_machine.h
index 4ec31abdc..07b7b95f2 100644
--- a/include/pub_tool_machine.h
+++ b/include/pub_tool_machine.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -104,12 +104,6 @@
# define VG_CLREQ_SZB 20
# define VG_STACK_REDZONE_SZB 0
-#elif defined(VGP_tilegx_linux)
-# define VG_MIN_INSTR_SZB 8
-# define VG_MAX_INSTR_SZB 8
-# define VG_CLREQ_SZB 24
-# define VG_STACK_REDZONE_SZB 0
-
#else
# error Unknown platform
#endif
diff --git a/include/pub_tool_mallocfree.h b/include/pub_tool_mallocfree.h
index 0217f6757..46db0ff7f 100644
--- a/include/pub_tool_mallocfree.h
+++ b/include/pub_tool_mallocfree.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_options.h b/include/pub_tool_options.h
index 94ed5442f..0f93483c1 100644
--- a/include/pub_tool_options.h
+++ b/include/pub_tool_options.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -223,6 +223,26 @@ extern const HChar* VG_(clo_xml_user_comment);
extern VexControl VG_(clo_vex_control);
extern VexRegisterUpdates VG_(clo_px_file_backed);
+extern Int VG_(clo_redzone_size);
+
+typedef
+ enum {
+ Vg_XTMemory_None, // Do not do any xtree memory profiling.
+ Vg_XTMemory_Allocs, // Currently allocated size xtree memory profiling
+ Vg_XTMemory_Full, // Full profiling : Current allocated size, total
+ // allocated size, nr of blocks, total freed size, ...
+ }
+ VgXTMemory;
+// Tools that replace malloc can optionally implement memory profiling
+// following the value of VG_(clo_xtree_profile_memory) to produce a report
+// at the end of execution.
+extern VgXTMemory VG_(clo_xtree_memory);
+/* Holds the filename to use for xtree memory profiling output, before expansion
+ of %p and %q templates. */
+extern const HChar* VG_(clo_xtree_memory_file);
+/* Compress strings in xtree dumps. */
+extern Bool VG_(clo_xtree_compress_strings);
+
/* Number of parents of a backtrace. Default: 12 */
extern Int VG_(clo_backtrace_size);
diff --git a/include/pub_tool_oset.h b/include/pub_tool_oset.h
index 0c9799720..cfdb60363 100644
--- a/include/pub_tool_oset.h
+++ b/include/pub_tool_oset.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Nicholas Nethercote
+ Copyright (C) 2005-2017 Nicholas Nethercote
njn@valgrind.org
This program is free software; you can redistribute it and/or
@@ -77,13 +77,8 @@
typedef struct _OSet OSet;
-// - Cmp: returns -1, 0 or 1 if key is <, == or > elem.
-// - Alloc: allocates a chunk of memory.
-// - Free: frees a chunk of memory allocated with Alloc.
-
+// - OSetCmp_t: returns -1, 0 or 1 if key is <, == or > elem.
typedef Word (*OSetCmp_t) ( const void* key, const void* elem );
-typedef void* (*OSetAlloc_t) ( const HChar* cc, SizeT szB );
-typedef void (*OSetFree_t) ( void* p );
/*--------------------------------------------------------------------*/
/*--- Creating and destroying OSets (UWord) ---*/
@@ -103,8 +98,8 @@ typedef void (*OSetFree_t) ( void* p );
// to allow the destruction of any attached resources; if NULL it is not
// called.
-extern OSet* VG_(OSetWord_Create) ( OSetAlloc_t alloc_fn, const HChar* cc,
- OSetFree_t free_fn );
+extern OSet* VG_(OSetWord_Create) ( Alloc_Fn_t alloc_fn, const HChar* cc,
+ Free_Fn_t free_fn );
extern void VG_(OSetWord_Destroy) ( OSet* os );
/*--------------------------------------------------------------------*/
@@ -204,14 +199,14 @@ extern Bool VG_(OSetWord_Next) ( OSet* os, /*OUT*/UWord* val );
// lead to assertions in Valgrind's allocator.
extern OSet* VG_(OSetGen_Create) ( PtrdiffT keyOff, OSetCmp_t cmp,
- OSetAlloc_t alloc_fn, const HChar* cc,
- OSetFree_t free_fn);
+ Alloc_Fn_t alloc_fn, const HChar* cc,
+ Free_Fn_t free_fn);
extern OSet* VG_(OSetGen_Create_With_Pool) ( PtrdiffT keyOff, OSetCmp_t cmp,
- OSetAlloc_t alloc_fn,
+ Alloc_Fn_t alloc_fn,
const HChar* cc,
- OSetFree_t free_fn,
+ Free_Fn_t free_fn,
SizeT poolSize,
SizeT maxEltSize);
// Same as VG_(OSetGen_Create) but created OSet will use a pool allocator to
diff --git a/include/pub_tool_poolalloc.h b/include/pub_tool_poolalloc.h
index 549569fef..cc54b7ee1 100644
--- a/include/pub_tool_poolalloc.h
+++ b/include/pub_tool_poolalloc.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2011-2015 OpenWorks LLP info@open-works.co.uk,
+ Copyright (C) 2011-2017 OpenWorks LLP info@open-works.co.uk,
Philippe Waroquiers philippe.waroquiers@skynet.be
This program is free software; you can redistribute it and/or
@@ -56,9 +56,9 @@ typedef struct _PoolAlloc PoolAlloc;
This function never returns NULL. */
extern PoolAlloc* VG_(newPA) ( UWord elemSzB,
UWord nPerPool,
- void* (*alloc)(const HChar*, SizeT),
+ Alloc_Fn_t alloc_fn,
const HChar* cc,
- void (*free_fn)(void*) );
+ Free_Fn_t free_fn );
/* Free all memory associated with a PoolAlloc. */
diff --git a/include/pub_tool_rangemap.h b/include/pub_tool_rangemap.h
index 208b9dc73..080fa95b4 100644
--- a/include/pub_tool_rangemap.h
+++ b/include/pub_tool_rangemap.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2014-2015 Mozilla Foundation
+ Copyright (C) 2014-2017 Mozilla Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -47,9 +47,9 @@ typedef struct _RangeMap RangeMap;
succeeded.) The new array will contain a single range covering the
entire key space, which will be bound to the value |initialVal|.
This function never returns NULL. */
-RangeMap* VG_(newRangeMap) ( void*(*alloc_fn)(const HChar*,SizeT),
+RangeMap* VG_(newRangeMap) ( Alloc_Fn_t alloc_fn,
const HChar* cc,
- void(*free_fn)(void*),
+ Free_Fn_t free_fn,
UWord initialVal );
/* Free all memory associated with a RangeMap. */
diff --git a/include/pub_tool_redir.h b/include/pub_tool_redir.h
index 4ff515596..c97941ff4 100644
--- a/include/pub_tool_redir.h
+++ b/include/pub_tool_redir.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -185,9 +185,10 @@
@ --> ZA (at)
$ --> ZD (dollar)
( --> ZL (left)
+ % --> ZP (percent)
) --> ZR (right)
+ / --> ZS (slash)
Z --> ZZ (Z)
- / --> ZS (slash)
Everything else is left unchanged.
*/
@@ -243,8 +244,11 @@
/* --- Soname of the standard C library. --- */
#if defined(VGO_linux) || defined(VGO_solaris)
+# if defined(MUSL_LIBC)
+# define VG_Z_LIBC_SONAME libcZdZa // libc.*
+#else
# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so*
-
+#endif
#elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6)
# define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib
@@ -275,7 +279,11 @@
/* --- Soname of the pthreads library. --- */
#if defined(VGO_linux)
+# if defined(MUSL_LIBC)
+# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
+#else
# define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
+#endif
#elif defined(VGO_darwin)
# define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
#elif defined(VGO_solaris)
diff --git a/include/pub_tool_replacemalloc.h b/include/pub_tool_replacemalloc.h
index 2ce7ba596..e237fff16 100644
--- a/include/pub_tool_replacemalloc.h
+++ b/include/pub_tool_replacemalloc.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_seqmatch.h b/include/pub_tool_seqmatch.h
index 3b0b210f0..760aecbdf 100644
--- a/include/pub_tool_seqmatch.h
+++ b/include/pub_tool_seqmatch.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2008-2015 OpenWorks Ltd
+ Copyright (C) 2008-2017 OpenWorks Ltd
info@open-works.co.uk
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_signals.h b/include/pub_tool_signals.h
index 1bab4787d..045e1d40a 100644
--- a/include/pub_tool_signals.h
+++ b/include/pub_tool_signals.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_sparsewa.h b/include/pub_tool_sparsewa.h
index 982bfaccf..84c983d21 100644
--- a/include/pub_tool_sparsewa.h
+++ b/include/pub_tool_sparsewa.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2008-2015 OpenWorks Ltd
+ Copyright (C) 2008-2017 OpenWorks Ltd
info@open-works.co.uk
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_stacktrace.h b/include/pub_tool_stacktrace.h
index 57dfbce89..c442d394d 100644
--- a/include/pub_tool_stacktrace.h
+++ b/include/pub_tool_stacktrace.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -66,7 +66,7 @@ extern UInt VG_(get_StackTrace) ( ThreadId tid,
// Apply a function to every element in the StackTrace. The parameter
// 'n' gives the index of the passed ip. 'opaque' is an arbitrary
-// pointer provided to each invokation of 'action' (a poor man's
+// pointer provided to each invocation of 'action' (a poor man's
// closure). Doesn't go below main() unless --show-below-main=yes is
// set.
extern void VG_(apply_StackTrace)(
diff --git a/include/pub_tool_threadstate.h b/include/pub_tool_threadstate.h
index 7ad176c07..5aec49da9 100644
--- a/include/pub_tool_threadstate.h
+++ b/include/pub_tool_threadstate.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_tooliface.h b/include/pub_tool_tooliface.h
index f7805e92b..9f9d20af9 100644
--- a/include/pub_tool_tooliface.h
+++ b/include/pub_tool_tooliface.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_transtab.h b/include/pub_tool_transtab.h
index fcfc1e0b9..63a2aa544 100644
--- a/include/pub_tool_transtab.h
+++ b/include/pub_tool_transtab.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2014-2015 Florian Krohm (florian@eich-krohm.de)
+ Copyright (C) 2014-2017 Florian Krohm (florian@eich-krohm.de)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/pub_tool_vki.h b/include/pub_tool_vki.h
index db7b84f32..9c1615e4b 100644
--- a/include/pub_tool_vki.h
+++ b/include/pub_tool_vki.h
@@ -8,11 +8,11 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
- Copyright (C) 2005-2015 Nicholas Nethercote
+ Copyright (C) 2005-2017 Nicholas Nethercote
njn@valgrind.org
- Copyright (C) 2006-2015 OpenWorks LLP
+ Copyright (C) 2006-2017 OpenWorks LLP
info@open-works.co.uk
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_vkiscnums.h b/include/pub_tool_vkiscnums.h
index ff5df5829..721948b20 100644
--- a/include/pub_tool_vkiscnums.h
+++ b/include/pub_tool_vkiscnums.h
@@ -7,9 +7,9 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Nicholas Nethercote
+ Copyright (C) 2005-2017 Nicholas Nethercote
njn@valgrind.org
- Copyright (C) 2006-2015 OpenWorks LLP
+ Copyright (C) 2006-2017 OpenWorks LLP
info@open-works.co.uk
This program is free software; you can redistribute it and/or
diff --git a/include/pub_tool_vkiscnums_asm.h b/include/pub_tool_vkiscnums_asm.h
index d6ea52a14..218175752 100644
--- a/include/pub_tool_vkiscnums_asm.h
+++ b/include/pub_tool_vkiscnums_asm.h
@@ -7,9 +7,9 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Nicholas Nethercote
+ Copyright (C) 2005-2017 Nicholas Nethercote
njn@valgrind.org
- Copyright (C) 2006-2015 OpenWorks LLP
+ Copyright (C) 2006-2017 OpenWorks LLP
info@open-works.co.uk
This program is free software; you can redistribute it and/or
@@ -63,9 +63,6 @@
#elif defined(VGP_x86_darwin) || defined(VGP_amd64_darwin)
# include "vki/vki-scnums-darwin.h"
-#elif defined(VGP_tilegx_linux)
-# include "vki/vki-scnums-tilegx-linux.h"
-
#elif defined(VGP_x86_solaris) || (VGP_amd64_solaris)
# include "vki/vki-scnums-solaris.h"
diff --git a/include/pub_tool_wordfm.h b/include/pub_tool_wordfm.h
index 239ae941c..5a3d6da22 100644
--- a/include/pub_tool_wordfm.h
+++ b/include/pub_tool_wordfm.h
@@ -9,13 +9,13 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2007-2015 Julian Seward
+ Copyright (C) 2007-2017 Julian Seward
jseward@acm.org
This code is based on previous work by Nicholas Nethercote
(coregrind/m_oset.c) which is
- Copyright (C) 2005-2015 Nicholas Nethercote
+ Copyright (C) 2005-2017 Nicholas Nethercote
njn@valgrind.org
which in turn was derived partially from:
diff --git a/include/pub_tool_xarray.h b/include/pub_tool_xarray.h
index 2b0fe9930..fd3faaf7a 100644
--- a/include/pub_tool_xarray.h
+++ b/include/pub_tool_xarray.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2007-2015 OpenWorks LLP
+ Copyright (C) 2007-2017 OpenWorks LLP
info@open-works.co.uk
This program is free software; you can redistribute it and/or
@@ -54,9 +54,9 @@ typedef Int (*XACmpFn_t)(const void *, const void *);
for elements of the specified size. alloc_fn must not return NULL (that
is, if it returns it must have succeeded.)
This function never returns NULL. */
-extern XArray* VG_(newXA) ( void*(*alloc_fn)(const HChar*,SizeT),
+extern XArray* VG_(newXA) ( Alloc_Fn_t alloc_fn,
const HChar* cc,
- void(*free_fn)(void*),
+ Free_Fn_t free_fn,
Word elemSzB );
/* Free all memory associated with an XArray. */
@@ -166,6 +166,8 @@ extern void VG_(getContentsXA_UNSAFE)( XArray* sr,
extern void VG_(xaprintf)( XArray* dst, const HChar* format, ... )
PRINTF_CHECK(2, 3);
+/* Convenience function: linear search in an XArray of HChar*. */
+extern Bool VG_(strIsMemberXA)(const XArray* xa, const HChar* str );
#endif // __PUB_TOOL_XARRAY_H
/*--------------------------------------------------------------------*/
diff --git a/include/pub_tool_xtmemory.h b/include/pub_tool_xtmemory.h
new file mode 100644
index 000000000..4b899d430
--- /dev/null
+++ b/include/pub_tool_xtmemory.h
@@ -0,0 +1,86 @@
+
+/*-----------------------------------------------------------------------*/
+/*--- Support functions for xtree memory reports. pub_tool_xtmemory.h ---*/
+/*-----------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2016-2017 Philippe Waroquiers
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_TOOL_XTMEMORY_H
+#define __PUB_TOOL_XTMEMORY_H
+
+/* Type to profile allocated size and nr of blocks, typically used for
+ --xtree-memory=allocs. */
+typedef
+ struct _XT_Allocs {
+ SizeT nbytes;
+ SizeT nblocks;
+ } XT_Allocs;
+
+/* Support functions to produce a full xtree memory profiling. */
+/* tool must call VG_(XTMemory_Full_init) to ini full xtree memory profiling. */
+extern void VG_(XTMemory_Full_init) (XT_filter_IPs_t filter_IPs_Fn);
+/* Then each time a certain nr of blocks are allocated or freed, the below
+ functions must be called. The arguments are:
+ szB: nr of bytes for the allocated/freed block(s)
+ ec_alloc : ExeContext of the allocation (original allocation for
+ free and resize_in_place).
+ ec_free : ExeContext of the free.
+ The tool is responsible to properly provide the ExeContext for
+ the allocation and free. For VG_(XTMemory_Full_free), ec_alloc
+ must be the one that was used for the allocation of the just released
+ block. */
+extern void VG_(XTMemory_Full_alloc)(SizeT szB,
+ ExeContext* ec_alloc);
+extern void VG_(XTMemory_Full_free)(SizeT szB,
+ ExeContext* ec_alloc,
+ ExeContext* ec_free);
+extern void VG_(XTMemory_Full_resize_in_place)(SizeT oldSzB, SizeT newSzB,
+ ExeContext* ec_alloc);
+
+/* Handle the production of a xtree memory report, either during run (fini False
+ e.g. via a gdb monitor command), or at the end of execution (fini True).
+
+ VG_(XTMemory_report) behaviour depends on the value of the command line
+ options --xtree-memory=none|allocs|full and --xtree-memory-file=<filename> :
+ If --xtree-memory=full, the report will be produced from the data
+ provided via the calls to void VG_(XTMemory_Full_*).
+ Otherwise, for --xtree-memory=allocs or for --xtree-memory=none (if fini
+ is False), next_block is used to get the data for the report:
+ next_block is called repetitively to get information about all allocated
+ blocks, till xta->nblocks is 0.
+ If filename is NULL, --xtree-memory-file is used to produce the name.
+ filter_IPs_fn : used for --xtree-memory=allocs/none filtering (see
+ VG_(XT_create) and XT_filter_IPs_t typdef for more information). */
+extern void VG_(XTMemory_report)
+ (const HChar* filename, Bool fini,
+ void (*next_block)(XT_Allocs* xta, ExeContext** ec_alloc),
+ XT_filter_IPs_t filter_IPs_fn);
+
+#endif // __PUB_TOOL_XTMEMORY_H
+
+
+/*-----------------------------------------------------------------------*/
+/*--- end pub_tool_xtmemory.h ---*/
+/*-----------------------------------------------------------------------*/
diff --git a/include/pub_tool_xtree.h b/include/pub_tool_xtree.h
new file mode 100644
index 000000000..ba9ad34c1
--- /dev/null
+++ b/include/pub_tool_xtree.h
@@ -0,0 +1,248 @@
+
+/*--------------------------------------------------------------------*/
+/*--- An xtree, tree of stacktraces with data pub_tool_xtree.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2015-2017 Philippe Waroquiers
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_TOOL_XTREE_H
+#define __PUB_TOOL_XTREE_H
+
+#include "pub_tool_basics.h"
+#include "pub_tool_execontext.h"
+
+//--------------------------------------------------------------------
+// PURPOSE: an XTree is conceptually a set of stacktraces organised
+// as a tree structure.
+// A stacktrace (an Addr* ips, i.e. an array of IPs : Instruction Pointers)
+// can be added to the tree once transformed into an execontext (ec).
+// Some data (typically one or more integer values) can be attached to
+// leafs of the tree.
+// Non-leaf nodes data is build by combining (typically adding together)
+// the data of their children nodes.
+// An XTree can be output in various formats.
+//
+//--------------------------------------------------------------------
+
+
+/* It's an abstract type. */
+typedef struct _XTree XTree;
+
+/* 3 functions types used by an xtree to manipulate the data attached to leafs
+ of an XTree.
+ XT_init_data_t function is used to initialise (typically to 0) the data
+ of a new node.
+ XT_add_data_t function is used to add 'value' to the data 'to'.
+ XT_sub_data_t function is used to substract 'value' from the data 'from'.
+
+ Note that the add/sub functions can do whatever operations to
+ combine/integrate value with/into to or from. In other words, add/sub
+ functions are in fact equivalent to 'Reduce' functions. Add/sub is used
+ as it is assumed that this module will be mostly used to follow
+ resource consumption, which can be more clearly modelled with add/sub.
+ For such resource consumption usage, typically, a call to add means that
+ some additional resource has been allocated or consumed or ... by the
+ given ExeContext. Similarly, a call to sub means that some resource
+ has been released/freed/... by the given execontext.
+
+ Note however that there is no constraints in what add (or sub) can do. For
+ example, the add function could maintain Min/Max values, or an histogram of
+ values, or ... */
+typedef void (*XT_init_data_t) (void* value);
+typedef void (*XT_add_data_t) (void* to, const void* value);
+typedef void (*XT_sub_data_t) (void* from, const void* value);
+
+/* If not NULL, the XT_filter_IPs_t function is called when a new ec is inserted
+ in the XTree.
+ It indicates to the XTree to filter a range of IPs at the top and/or at
+ the bottom of the ec Stacktrace : *top is the offset of the first IP to take
+ into account. *n_ips_sel is the nr of IPs selected starting from *top.
+
+ If XT_filter_IPs_t gives *n_ips_sel equal to 0, then the inserted ec will
+ be fully ignored when outputting the xtree:
+ the ec value(s) will not be counted in the XTree total,
+ the ec will not be printed/shown.
+ Note however that the filtering only influences the output of an XTree :
+ the ec is still inserted in the XTree, and the XT_*_data_t functions are
+ called in any case for such filtered ec. */
+typedef void (*XT_filter_IPs_t) (Addr* ips, Int n_ips,
+ UInt* top, UInt* n_ips_sel);
+
+/* Create new XTree, using given allocation and free function.
+ This function never returns NULL.
+ cc is the allocation cost centre.
+ alloc_fn must not return NULL (that is, if it returns it must have
+ succeeded.).
+ See respective typedef for *_fn arguments. */
+extern XTree* VG_(XT_create) ( Alloc_Fn_t alloc_fn,
+ const HChar* cc,
+ Free_Fn_t free_fn,
+ Word dataSzB,
+ XT_init_data_t init_data_fn,
+ XT_add_data_t add_data_fn,
+ XT_sub_data_t sub_data_fn,
+ XT_filter_IPs_t filter_IPs_fn);
+
+
+/* General useful filtering functions. */
+
+/* Filter functions below main, unless VG_(clo_show_below_main) is True. */
+extern void VG_(XT_filter_maybe_below_main)
+ (Addr* ips, Int n_ips,
+ UInt* top, UInt* n_ips_sel);
+/* Same as VG_(XT_filter_maybe_below_main) but also filters one top function
+ (typically to ignore the top level malloc/new/... fn). */
+extern void VG_(XT_filter_1top_and_maybe_below_main)
+ (Addr* ips, Int n_ips,
+ UInt* top, UInt* n_ips_sel);
+
+/* Search in ips[0..n_ips-1] the first function which is main or below main
+ and return its offset.
+ If no main or below main is found, return n_ips-1 */
+extern Int VG_(XT_offset_main_or_below_main)(Addr* ips, Int n_ips);
+
+
+/* Take a (frozen) snapshot of xt.
+ Note that the resulting XTree is 'read-only' : calls to
+ VG_(XT_add_to_*)/VG_(XT_sub_from_*) will assert.
+
+ Note: to spare memory, some data is shared between an xt and all its
+ snapshots. This memory is released when the last XTree using this memory
+ is deleted. */
+extern XTree* VG_(XT_snapshot)(XTree* xt);
+
+/* Non frozen dup currently not needed :
+ extern XTree* VG_(XT_dup)(XTree* xt); */
+
+/* Free all memory associated with an XTRee. */
+extern void VG_(XT_delete)(XTree* xt);
+
+/* an Xecu identifies an exe context+its associated data in an XTree. */
+typedef UInt Xecu;
+
+/* If not yet in xt, inserts the provided ec and initialises its
+ data by calling init_data_fn.
+ If already present (or after insertion), updates the data by calling
+ add_data_fn. */
+extern Xecu VG_(XT_add_to_ec)(XTree* xt, ExeContext* ec, const void* value);
+
+/* If not yet in xt, inserts the provided ec and initialises its
+ data by calling init_data_fn.
+ If already present (or after insertion), updates the data by calling
+ sub_data_fn to substract value from the data associated to ec. */
+extern Xecu VG_(XT_sub_from_ec)(XTree* xt, ExeContext* ec, const void* value);
+
+/* Same as (but more efficient than) VG_(XT_add_to_ec) and VG_(XT_sub_from_ec)
+ for an ec already inserted in xt. */
+extern void VG_(XT_add_to_xecu)(XTree* xt, Xecu xecu, const void* value);
+extern void VG_(XT_sub_from_xecu)(XTree* xt, Xecu xecu, const void* value);
+
+/* Return the nr of IPs selected for xecu. 0 means fully filtered. */
+extern UInt VG_(XT_n_ips_sel)(XTree* xt, Xecu xecu);
+
+/* Return the ExeContext associated to the Xecu. */
+extern ExeContext* VG_(XT_get_ec_from_xecu) (XTree* xt, Xecu xecu);
+
+/* -------------------- CALLGRIND/KCACHEGRIND OUTPUT FORMAT --------------*/
+/* Prints xt in outfilename in callgrind/kcachegrind format.
+ events is a comma separated list of events, used by
+ kcachegrind/callgrind_annotate/... to name the value various components.
+ An event can optionally have a longer description, separated from the
+ event name by " : ", e.g.
+ "curB : currently allocated Bytes,curBk : Currently allocated Blocks"
+ img_value returns an image of the value. The image must be a space
+ separated set of integers, matching the corresponding event in events.
+ Note that the returned pointer can be static data.
+ img_value can return NULL if value (and its associated ExeContext) should
+ not be printed.
+*/
+extern void VG_(XT_callgrind_print)
+ (XTree* xt,
+ const HChar* outfilename,
+ const HChar* events,
+ const HChar* (*img_value) (const void* value));
+
+
+/* -------------------- MASSIF OUTPUT FORMAT --------------*/
+// Time is measured either in i or ms or bytes, depending on the --time-unit
+// option. It's a Long because it can exceed 32-bits reasonably easily, and
+// because we need to allow negative values to represent unset times.
+typedef Long Time;
+
+typedef void MsFile;
+
+/* Create a new file or truncate existing file for printing xtrees in
+ massif format. time_unit is a string describing the unit used
+ in Massif_Header time.
+ Produces a user error msg and returns NULL if file cannot be opened.
+ Caller must VG_(XT_massif_close) the returned file. */
+extern MsFile* VG_(XT_massif_open)(const HChar* outfilename,
+ const HChar* desc, // can be NULL
+ const XArray* desc_args, // can be NULL
+ const HChar* time_unit);
+
+extern void VG_(XT_massif_close)(MsFile* fp);
+
+typedef
+ struct {
+ int snapshot_n; // starting at 0.
+ Time time;
+
+ ULong sz_B; // sum of values, only used when printing a NULL xt.
+ ULong extra_B;
+ ULong stacks_B;
+
+ Bool detailed;
+ Bool peak;
+
+ /* top_node_desc: description for the top node.
+ Typically for memory usage, give xt_heap_alloc_functions_desc. */
+ const HChar* top_node_desc;
+
+ /* children with less than sig_threshold * total xt sz will be aggregated
+ and printed as one single child. */
+ double sig_threshold;
+
+ } Massif_Header;
+
+/* Prints xt in outfilename in massif format.
+ If a NULL xt is provided, then only the header information is used
+ to produce the (necessarily not detailed) snapshot.
+ report_value must return the value to be used for the report production.
+ It will typically be the nr of bytes allocated stored with the execontext
+ but it could be anything measured with a ULong (e.g. the nr of blocks
+ allocated, or a number of calls, ...).
+*/
+extern void VG_(XT_massif_print)
+ (MsFile* fp,
+ XTree* xt,
+ const Massif_Header* header,
+ ULong (*report_value)(const void* value));
+
+#endif // __PUB_TOOL_XTREE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end pub_tool_xtree.h ---*/
+/*--------------------------------------------------------------------*/
diff --git a/include/valgrind.h b/include/valgrind.h
index 689200739..5aed0dfca 100644
--- a/include/valgrind.h
+++ b/include/valgrind.h
@@ -12,7 +12,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward. All rights reserved.
+ Copyright (C) 2000-2017 Julian Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -89,7 +89,7 @@
|| (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6))
*/
#define __VALGRIND_MAJOR__ 3
-#define __VALGRIND_MINOR__ 12
+#define __VALGRIND_MINOR__ 13
#include <stdarg.h>
@@ -122,7 +122,6 @@
#undef PLAT_s390x_linux
#undef PLAT_mips32_linux
#undef PLAT_mips64_linux
-#undef PLAT_tilegx_linux
#undef PLAT_x86_solaris
#undef PLAT_amd64_solaris
@@ -160,8 +159,6 @@
# define PLAT_mips64_linux 1
#elif defined(__linux__) && defined(__mips__) && (__mips!=64)
# define PLAT_mips32_linux 1
-#elif defined(__linux__) && defined(__tilegx__)
-# define PLAT_tilegx_linux 1
#elif defined(__sun) && defined(__i386__)
# define PLAT_x86_solaris 1
#elif defined(__sun) && defined(__x86_64__)
@@ -1048,73 +1045,6 @@ typedef
#endif /* PLAT_mips64_linux */
-/* ------------------------ tilegx-linux --------------- */
-#if defined(PLAT_tilegx_linux)
-
-typedef
- struct {
- unsigned long long int nraddr; /* where's the code? */
- }
- OrigFn;
-/*** special instruction sequence.
- 0:02b3c7ff91234fff { moveli zero, 4660 ; moveli zero, 22136 }
- 8:0091a7ff95678fff { moveli zero, 22136 ; moveli zero, 4660 }
-****/
-
-#define __SPECIAL_INSTRUCTION_PREAMBLE \
- ".quad 0x02b3c7ff91234fff\n" \
- ".quad 0x0091a7ff95678fff\n"
-
-#define VALGRIND_DO_CLIENT_REQUEST_EXPR( \
- _zzq_default, _zzq_request, \
- _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
- ({ volatile unsigned long long int _zzq_args[6]; \
- volatile unsigned long long int _zzq_result; \
- _zzq_args[0] = (unsigned long long int)(_zzq_request); \
- _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \
- _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \
- _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \
- _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \
- _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \
- __asm__ volatile("move r11, %1\n\t" /*default*/ \
- "move r12, %2\n\t" /*ptr*/ \
- __SPECIAL_INSTRUCTION_PREAMBLE \
- /* r11 = client_request */ \
- "or r13, r13, r13\n\t" \
- "move %0, r11\n\t" /*result*/ \
- : "=r" (_zzq_result) \
- : "r" (_zzq_default), "r" (&_zzq_args[0]) \
- : "memory", "r11", "r12"); \
- _zzq_result; \
- })
-
-#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
- { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \
- volatile unsigned long long int __addr; \
- __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
- /* r11 = guest_NRADDR */ \
- "or r14, r14, r14\n" \
- "move %0, r11\n" \
- : "=r" (__addr) \
- : \
- : "memory", "r11" \
- ); \
- _zzq_orig->nraddr = __addr; \
- }
-
-#define VALGRIND_CALL_NOREDIR_R12 \
- __SPECIAL_INSTRUCTION_PREAMBLE \
- "or r15, r15, r15\n\t"
-
-#define VALGRIND_VEX_INJECT_IR() \
- do { \
- __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
- "or r11, r11, r11\n\t" \
- ); \
- } while (0)
-
-#endif /* PLAT_tilegx_linux */
-
/* Insert assembly code for other platforms here... */
#endif /* NVALGRIND */
@@ -2708,7 +2638,7 @@ typedef
#define __CALLER_SAVED_REGS \
"lr", "ctr", "xer", \
"cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \
- "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \
+ "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \
"r11", "r12", "r13"
/* Macros to save and align the stack before making a function
@@ -3264,7 +3194,7 @@ typedef
#define __CALLER_SAVED_REGS \
"lr", "ctr", "xer", \
"cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", \
- "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \
+ "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \
"r11", "r12", "r13"
/* Macros to save and align the stack before making a function
@@ -6165,461 +6095,6 @@ typedef
#endif /* PLAT_mips64_linux */
-/* ------------------------ tilegx-linux ------------------------- */
-
-#if defined(PLAT_tilegx_linux)
-
-/* These regs are trashed by the hidden call. */
-#define __CALLER_SAVED_REGS "r0", "r1", "r2", "r3", "r4", "r5", \
- "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", \
- "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", \
- "r23", "r24", "r25", "r26", "r27", "r28", "r29", "lr"
-
-/* These CALL_FN_ macros assume that on tilegx-linux, sizeof(unsigned
- long) == 8. */
-
-#define CALL_FN_W_v(lval, orig) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[1]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "ld r12, %1 \n\t" /* target->r11 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0 \n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_W(lval, orig, arg1) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[2]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_WW(lval, orig, arg1,arg2) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[3]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[4]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8 \n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[5]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[6]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- _argvec[5] = (unsigned long)(arg5); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- "ld_add r4, r29, 8 \n\t" /*arg5 -> r4 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[7]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- _argvec[5] = (unsigned long)(arg5); \
- _argvec[6] = (unsigned long)(arg6); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- "ld_add r4, r29, 8 \n\t" /*arg5 -> r4 */ \
- "ld_add r5, r29, 8 \n\t" /*arg6 -> r5 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
- arg7) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[8]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- _argvec[5] = (unsigned long)(arg5); \
- _argvec[6] = (unsigned long)(arg6); \
- _argvec[7] = (unsigned long)(arg7); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- "ld_add r4, r29, 8 \n\t" /*arg5 -> r4 */ \
- "ld_add r5, r29, 8 \n\t" /*arg6 -> r5 */ \
- "ld_add r6, r29, 8 \n\t" /*arg7 -> r6 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
- arg7,arg8) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[9]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- _argvec[5] = (unsigned long)(arg5); \
- _argvec[6] = (unsigned long)(arg6); \
- _argvec[7] = (unsigned long)(arg7); \
- _argvec[8] = (unsigned long)(arg8); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- "ld_add r4, r29, 8 \n\t" /*arg5 -> r4 */ \
- "ld_add r5, r29, 8 \n\t" /*arg6 -> r5 */ \
- "ld_add r6, r29, 8 \n\t" /*arg7 -> r6 */ \
- "ld_add r7, r29, 8 \n\t" /*arg8 -> r7 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
- arg7,arg8,arg9) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[10]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- _argvec[5] = (unsigned long)(arg5); \
- _argvec[6] = (unsigned long)(arg6); \
- _argvec[7] = (unsigned long)(arg7); \
- _argvec[8] = (unsigned long)(arg8); \
- _argvec[9] = (unsigned long)(arg9); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- "ld_add r4, r29, 8 \n\t" /*arg5 -> r4 */ \
- "ld_add r5, r29, 8 \n\t" /*arg6 -> r5 */ \
- "ld_add r6, r29, 8 \n\t" /*arg7 -> r6 */ \
- "ld_add r7, r29, 8 \n\t" /*arg8 -> r7 */ \
- "ld_add r8, r29, 8 \n\t" /*arg9 -> r8 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6, \
- arg7,arg8,arg9,arg10) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[11]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- _argvec[5] = (unsigned long)(arg5); \
- _argvec[6] = (unsigned long)(arg6); \
- _argvec[7] = (unsigned long)(arg7); \
- _argvec[8] = (unsigned long)(arg8); \
- _argvec[9] = (unsigned long)(arg9); \
- _argvec[10] = (unsigned long)(arg10); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- "ld_add r4, r29, 8 \n\t" /*arg5 -> r4 */ \
- "ld_add r5, r29, 8 \n\t" /*arg6 -> r5 */ \
- "ld_add r6, r29, 8 \n\t" /*arg7 -> r6 */ \
- "ld_add r7, r29, 8 \n\t" /*arg8 -> r7 */ \
- "ld_add r8, r29, 8 \n\t" /*arg9 -> r8 */ \
- "ld_add r9, r29, 8 \n\t" /*arg10 -> r9 */ \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 8\n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
- arg6,arg7,arg8,arg9,arg10, \
- arg11) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[12]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- _argvec[5] = (unsigned long)(arg5); \
- _argvec[6] = (unsigned long)(arg6); \
- _argvec[7] = (unsigned long)(arg7); \
- _argvec[8] = (unsigned long)(arg8); \
- _argvec[9] = (unsigned long)(arg9); \
- _argvec[10] = (unsigned long)(arg10); \
- _argvec[11] = (unsigned long)(arg11); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- "ld_add r4, r29, 8 \n\t" /*arg5 -> r4 */ \
- "ld_add r5, r29, 8 \n\t" /*arg6 -> r5 */ \
- "ld_add r6, r29, 8 \n\t" /*arg7 -> r6 */ \
- "ld_add r7, r29, 8 \n\t" /*arg8 -> r7 */ \
- "ld_add r8, r29, 8 \n\t" /*arg9 -> r8 */ \
- "ld_add r9, r29, 8 \n\t" /*arg10 -> r9 */ \
- "ld r10, r29 \n\t" \
- "st_add sp, r10, -16 \n\t" \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 24 \n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-
-#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5, \
- arg6,arg7,arg8,arg9,arg10, \
- arg11,arg12) \
- do { \
- volatile OrigFn _orig = (orig); \
- volatile unsigned long _argvec[13]; \
- volatile unsigned long _res; \
- _argvec[0] = (unsigned long)_orig.nraddr; \
- _argvec[1] = (unsigned long)(arg1); \
- _argvec[2] = (unsigned long)(arg2); \
- _argvec[3] = (unsigned long)(arg3); \
- _argvec[4] = (unsigned long)(arg4); \
- _argvec[5] = (unsigned long)(arg5); \
- _argvec[6] = (unsigned long)(arg6); \
- _argvec[7] = (unsigned long)(arg7); \
- _argvec[8] = (unsigned long)(arg8); \
- _argvec[9] = (unsigned long)(arg9); \
- _argvec[10] = (unsigned long)(arg10); \
- _argvec[11] = (unsigned long)(arg11); \
- _argvec[12] = (unsigned long)(arg12); \
- __asm__ volatile( \
- "addi sp, sp, -8 \n\t" \
- "st_add sp, lr, -8 \n\t" \
- "move r29, %1 \n\t" \
- "ld_add r12, r29, 8 \n\t" /* target->r11 */ \
- "ld_add r0, r29, 8 \n\t" /*arg1 -> r0 */ \
- "ld_add r1, r29, 8 \n\t" /*arg2 -> r1 */ \
- "ld_add r2, r29, 8 \n\t" /*arg3 -> r2 */ \
- "ld_add r3, r29, 8 \n\t" /*arg4 -> r3 */ \
- "ld_add r4, r29, 8 \n\t" /*arg5 -> r4 */ \
- "ld_add r5, r29, 8 \n\t" /*arg6 -> r5 */ \
- "ld_add r6, r29, 8 \n\t" /*arg7 -> r6 */ \
- "ld_add r7, r29, 8 \n\t" /*arg8 -> r7 */ \
- "ld_add r8, r29, 8 \n\t" /*arg9 -> r8 */ \
- "ld_add r9, r29, 8 \n\t" /*arg10 -> r9 */ \
- "addi r28, sp, -8 \n\t" \
- "addi sp, sp, -24 \n\t" \
- "ld_add r10, r29, 8 \n\t" \
- "ld r11, r29 \n\t" \
- "st_add r28, r10, 8 \n\t" \
- "st r28, r11 \n\t" \
- VALGRIND_CALL_NOREDIR_R12 \
- "addi sp, sp, 32 \n\t" \
- "ld_add lr, sp, 8 \n\t" \
- "move %0, r0\n" \
- : /*out*/ "=r" (_res) \
- : /*in*/ "r" (&_argvec[0]) \
- : /*trash*/ "memory", __CALLER_SAVED_REGS); \
- lval = (__typeof__(lval)) _res; \
- } while (0)
-#endif /* PLAT_tilegx_linux */
-
/* ------------------------------------------------------------------ */
/* ARCHITECTURE INDEPENDENT MACROS for CLIENT REQUESTS. */
/* */
@@ -6642,8 +6117,9 @@ typedef
/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
This enum comprises an ABI exported by Valgrind to programs
- which use client requests. DO NOT CHANGE THE ORDER OF THESE
- ENTRIES, NOR DELETE ANY -- add new ones at the end. */
+ which use client requests. DO NOT CHANGE THE NUMERIC VALUES OF THESE
+ ENTRIES, NOR DELETE ANY -- add new ones at the end of the most
+ relevant group. */
typedef
enum { VG_USERREQ__RUNNING_ON_VALGRIND = 0x1001,
VG_USERREQ__DISCARD_TRANSLATIONS = 0x1002,
@@ -6713,8 +6189,13 @@ typedef
Other values are not allowed. */
VG_USERREQ__CHANGE_ERR_DISABLEMENT = 0x1801,
+ /* Some requests used for Valgrind internal, such as
+ self-test or self-hosting. */
/* Initialise IR injection */
- VG_USERREQ__VEX_INIT_FOR_IRI = 0x1901
+ VG_USERREQ__VEX_INIT_FOR_IRI = 0x1901,
+ /* Used by Inner Valgrind to inform Outer Valgrind where to
+ find the list of inner guest threads */
+ VG_USERREQ__INNER_THREADS = 0x1902
} Vg_ClientRequest;
#if !defined(__GNUC__)
@@ -6740,6 +6221,10 @@ typedef
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DISCARD_TRANSLATIONS, \
_qzz_addr, _qzz_len, 0, 0, 0)
+#define VALGRIND_INNER_THREADS(_qzz_addr) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__INNER_THREADS, \
+ _qzz_addr, 0, 0, 0, 0)
+
/* These requests are for getting Valgrind itself to print something.
Possibly with a backtrace. This is a really ugly hack. The return value
@@ -6759,7 +6244,7 @@ __inline
VALGRIND_PRINTF(const char *format, ...)
{
#if defined(NVALGRIND)
- if (format) *(volatile const char *)format; /* avoid compiler warning */
+ (void)format;
return 0;
#else /* NVALGRIND */
#if defined(_MSC_VER) || defined(__MINGW64__)
@@ -6798,7 +6283,7 @@ __inline
VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
{
#if defined(NVALGRIND)
- if (format) *(volatile const char *)format; /* avoid compiler warning */
+ (void)format;
return 0;
#else /* NVALGRIND */
#if defined(_MSC_VER) || defined(__MINGW64__)
@@ -6828,7 +6313,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
/* These requests allow control to move from the simulated CPU to the
- real CPU, calling an arbitary function.
+ real CPU, calling an arbitrary function.
Note that the current ThreadId is inserted as the first argument.
So this call:
@@ -7153,7 +6638,6 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
#undef PLAT_s390x_linux
#undef PLAT_mips32_linux
#undef PLAT_mips64_linux
-#undef PLAT_tilegx_linux
#undef PLAT_x86_solaris
#undef PLAT_amd64_solaris
diff --git a/include/vgversion.h b/include/vgversion.h
new file mode 100644
index 000000000..6d9e22ca7
--- /dev/null
+++ b/include/vgversion.h
@@ -0,0 +1,6 @@
+/* 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 "16445:16446"
+#define VEXSVN "3396"
diff --git a/include/vgversion_dist.h b/include/vgversion_dist.h
new file mode 100644
index 000000000..6d9e22ca7
--- /dev/null
+++ b/include/vgversion_dist.h
@@ -0,0 +1,6 @@
+/* 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 "16445:16446"
+#define VEXSVN "3396"
diff --git a/include/vki/vki-amd64-linux.h b/include/vki/vki-amd64-linux.h
index db85b92d5..a506ade06 100644
--- a/include/vki/vki-amd64-linux.h
+++ b/include/vki/vki-amd64-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-arm-linux.h b/include/vki/vki-arm-linux.h
index fe7a17109..46577e9eb 100644
--- a/include/vki/vki-arm-linux.h
+++ b/include/vki/vki-arm-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-arm64-linux.h b/include/vki/vki-arm64-linux.h
index df34dd6c0..af6b43572 100644
--- a/include/vki/vki-arm64-linux.h
+++ b/include/vki/vki-arm64-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2013-2015 OpenWorks
+ Copyright (C) 2013-2017 OpenWorks
info@open-works.net
This program is free software; you can redistribute it and/or
@@ -586,7 +586,8 @@ struct vki_ucontext {
//ZZ };
//ZZ
//ZZ // [[Nb: for our convenience within Valgrind, use a more specific name]]
-//ZZ typedef struct vki_user_desc vki_modify_ldt_t;
+
+typedef char vki_modify_ldt_t;
//----------------------------------------------------------------------
// From linux-3.10.5/include/asm-generic/ipcbuf.h
diff --git a/include/vki/vki-darwin.h b/include/vki/vki-darwin.h
index 49d0d4c9a..72b66bf91 100644
--- a/include/vki/vki-darwin.h
+++ b/include/vki/vki-darwin.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2007-2015 Apple Inc.
+ Copyright (C) 2007-2017 Apple Inc.
Greg Parker gparker@apple.com
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
index bdb8f3393..4840a53e2 100644
--- a/include/vki/vki-linux.h
+++ b/include/vki/vki-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -97,8 +97,6 @@
# include "vki-posixtypes-mips32-linux.h"
#elif defined(VGA_mips64)
# include "vki-posixtypes-mips64-linux.h"
-#elif defined(VGA_tilegx)
-# include "vki-posixtypes-tilegx-linux.h"
#else
# error Unknown platform
#endif
@@ -225,8 +223,6 @@ typedef unsigned int vki_uint;
# include "vki-mips32-linux.h"
#elif defined(VGA_mips64)
# include "vki-mips64-linux.h"
-#elif defined(VGA_tilegx)
-# include "vki-tilegx-linux.h"
#else
# error Unknown platform
#endif
@@ -527,7 +523,7 @@ typedef struct vki_siginfo {
* SIGBUS si_codes
*/
#define VKI_BUS_ADRALN (__VKI_SI_FAULT|1) /* invalid address alignment */
-#define VKI_BUS_ADRERR (__VKI_SI_FAULT|2) /* non-existant physical address */
+#define VKI_BUS_ADRERR (__VKI_SI_FAULT|2) /* non-existent physical address */
#define VKI_BUS_OBJERR (__VKI_SI_FAULT|3) /* object specific hardware error */
/*
@@ -674,7 +670,8 @@ __KINLINE struct vki_cmsghdr * __vki_cmsg_nxthdr(void *__ctl, __vki_kernel_size_
{
struct vki_cmsghdr * __ptr;
- __ptr = (struct vki_cmsghdr*)(((unsigned char *) __cmsg) + VKI_CMSG_ALIGN(__cmsg->cmsg_len));
+ __ptr = ASSUME_ALIGNED(struct vki_cmsghdr *,
+ ((unsigned char *) __cmsg) + VKI_CMSG_ALIGN(__cmsg->cmsg_len));
if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
return (struct vki_cmsghdr *)0;
@@ -1415,6 +1412,22 @@ struct vki_dirent64 {
#define VKI_F_SETPIPE_SZ (VKI_F_LINUX_SPECIFIC_BASE + 7)
#define VKI_F_GETPIPE_SZ (VKI_F_LINUX_SPECIFIC_BASE + 8)
+struct vki_flock {
+ short l_type;
+ short l_whence;
+ __vki_kernel_off_t l_start;
+ __vki_kernel_off_t l_len;
+ __vki_kernel_pid_t l_pid;
+};
+
+struct vki_flock64 {
+ short l_type;
+ short l_whence;
+ __vki_kernel_loff_t l_start;
+ __vki_kernel_loff_t l_len;
+ __vki_kernel_pid_t l_pid;
+};
+
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/sysctl.h
//----------------------------------------------------------------------
@@ -1865,10 +1878,13 @@ struct vki_scsi_idlun {
(struct cdrom_tochdr) */
#define VKI_CDROMREADTOCENTRY 0x5306 /* Read TOC entry
(struct cdrom_tocentry) */
+#define VKI_CDROMSTOP 0x5307 /* Stop the cdrom drive */
#define VKI_CDROMSUBCHNL 0x530b /* Read subchannel data
(struct cdrom_subchnl) */
#define VKI_CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes)
(struct cdrom_read) */
+#define VKI_CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes)
+ (struct cdrom_read) */
#define VKI_CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */
#define VKI_CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session
address of multi session disks
@@ -1884,6 +1900,7 @@ struct vki_scsi_idlun {
#define VKI_CDROM_DISC_STATUS 0x5327 /* get CD type information */
#define VKI_CDROM_GET_CAPABILITY 0x5331 /* get capabilities */
+#define VKI_DVD_READ_STRUCT 0x5390 /* read structure */
#define VKI_CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */
struct vki_cdrom_msf0
@@ -1994,6 +2011,7 @@ struct vki_cdrom_generic_command
#define VKI_CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
#define VKI_CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
#define VKI_CD_FRAMESIZE_RAW0 (VKI_CD_FRAMESIZE_RAW-VKI_CD_SYNC_SIZE-VKI_CD_HEAD_SIZE) /*2336*/
+#define VKI_CD_FRAMESIZE_RAW1 2048 /* bytes per frame, mode 1*/
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/soundcard.h
@@ -2321,6 +2339,8 @@ typedef __vki_kernel_uid32_t vki_qid_t; /* Type in which we store ids in memory
#define VKI_PTRACE_GETREGSET 0x4204
#define VKI_PTRACE_SETREGSET 0x4205
+#define VKI_PT_PTRACED 0x00000001
+
//----------------------------------------------------------------------
// From linux-2.6.14/include/sound/asound.h
//----------------------------------------------------------------------
@@ -2773,7 +2793,7 @@ typedef vki_uint32_t vki_key_perm_t;
#define VKI_SIOCSIWPOWER 0x8B2C /* set Power Management settings */
#define VKI_SIOCGIWPOWER 0x8B2D /* get Power Management settings */
-/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM). */
+/* WPA : Generic IEEE 802.11 information element (e.g., for WPA/RSN/WMM). */
#define VKI_SIOCSIWGENIE 0x8B30 /* set generic IE */
#define VKI_SIOCGIWGENIE 0x8B31 /* get generic IE */
@@ -2800,7 +2820,7 @@ struct vki_iw_param
__vki_s32 value; /* The value of the parameter itself */
__vki_u8 fixed; /* Hardware should not use auto select */
__vki_u8 disabled; /* Disable the feature */
- __vki_u16 flags; /* Various specifc flags (if any) */
+ __vki_u16 flags; /* Various specific flags (if any) */
};
struct vki_iw_point
diff --git a/include/vki/vki-mips32-linux.h b/include/vki/vki-mips32-linux.h
index 5be8e1562..7aba35582 100644
--- a/include/vki/vki-mips32-linux.h
+++ b/include/vki/vki-mips32-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2010-2015 RT-RK
+ Copyright (C) 2010-2017 RT-RK
mips-valgrind@rt-rk.com
This program is free software; you can redistribute it and/or
@@ -679,7 +679,7 @@ struct vki_ucontext {
};
// CAB: TODO
-typedef void vki_modify_ldt_t;
+typedef char vki_modify_ldt_t;
//----------------------------------------------------------------------
// From linux-2.6.35.5/include/asm-mips/ipcbuf.h
diff --git a/include/vki/vki-mips64-linux.h b/include/vki/vki-mips64-linux.h
index 26b8e9f98..c20c2980a 100644
--- a/include/vki/vki-mips64-linux.h
+++ b/include/vki/vki-mips64-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2010-2015 RT-RK
+ Copyright (C) 2010-2017 RT-RK
mips-valgrind@rt-rk.com
This program is free software; you can redistribute it and/or
@@ -710,6 +710,7 @@ struct vki_ucontext {
vki_sigset_t uc_sigmask; /* mask last for extensibility */
};
+typedef char vki_modify_ldt_t;
//----------------------------------------------------------------------
// From linux-2.6.35.9/include/asm-mips/ipcbuf.h
//----------------------------------------------------------------------
diff --git a/include/vki/vki-posixtypes-amd64-linux.h b/include/vki/vki-posixtypes-amd64-linux.h
index e68e214d9..342e41690 100644
--- a/include/vki/vki-posixtypes-amd64-linux.h
+++ b/include/vki/vki-posixtypes-amd64-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-posixtypes-arm-linux.h b/include/vki/vki-posixtypes-arm-linux.h
index 59943a8da..bc06ec9b2 100644
--- a/include/vki/vki-posixtypes-arm-linux.h
+++ b/include/vki/vki-posixtypes-arm-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-posixtypes-arm64-linux.h b/include/vki/vki-posixtypes-arm64-linux.h
index 7df53456c..d9acee0db 100644
--- a/include/vki/vki-posixtypes-arm64-linux.h
+++ b/include/vki/vki-posixtypes-arm64-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2013-2015 OpenWorks
+ Copyright (C) 2013-2017 OpenWorks
info@open-works.net
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-posixtypes-mips32-linux.h b/include/vki/vki-posixtypes-mips32-linux.h
index 4abe38af7..b65e3eda4 100644
--- a/include/vki/vki-posixtypes-mips32-linux.h
+++ b/include/vki/vki-posixtypes-mips32-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2010-2015 RT-RK
+ Copyright (C) 2010-2017 RT-RK
mips-valgrind@rt-rk.com
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-posixtypes-mips64-linux.h b/include/vki/vki-posixtypes-mips64-linux.h
index 4ebd59748..96d2728b7 100644
--- a/include/vki/vki-posixtypes-mips64-linux.h
+++ b/include/vki/vki-posixtypes-mips64-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2010-2015 RT-RK
+ Copyright (C) 2010-2017 RT-RK
mips-valgrind@rt-rk.com
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-posixtypes-ppc32-linux.h b/include/vki/vki-posixtypes-ppc32-linux.h
index 246195b6a..e72a8f6f7 100644
--- a/include/vki/vki-posixtypes-ppc32-linux.h
+++ b/include/vki/vki-posixtypes-ppc32-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Julian Seward
+ Copyright (C) 2005-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-posixtypes-ppc64-linux.h b/include/vki/vki-posixtypes-ppc64-linux.h
index afd0a50e8..ac385ea12 100644
--- a/include/vki/vki-posixtypes-ppc64-linux.h
+++ b/include/vki/vki-posixtypes-ppc64-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Julian Seward
+ Copyright (C) 2005-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-posixtypes-s390x-linux.h b/include/vki/vki-posixtypes-s390x-linux.h
index 6de95fc01..8e04c3dfa 100644
--- a/include/vki/vki-posixtypes-s390x-linux.h
+++ b/include/vki/vki-posixtypes-s390x-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright IBM Corp. 2010-2015
+ Copyright IBM Corp. 2010-2017
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-posixtypes-x86-linux.h b/include/vki/vki-posixtypes-x86-linux.h
index dedaa67b0..7f131d7b8 100644
--- a/include/vki/vki-posixtypes-x86-linux.h
+++ b/include/vki/vki-posixtypes-x86-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-ppc32-linux.h b/include/vki/vki-ppc32-linux.h
index 70c2835ee..0582e43d4 100644
--- a/include/vki/vki-ppc32-linux.h
+++ b/include/vki/vki-ppc32-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Julian Seward
+ Copyright (C) 2005-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -811,10 +811,9 @@ struct vki_ucontext {
//.. };
//..
//.. // [[Nb: for our convenience within Valgrind, use a more specific name]]
-//.. typedef struct vki_user_desc vki_modify_ldt_t;
// CAB: TODO
-typedef void vki_modify_ldt_t;
+typedef char vki_modify_ldt_t;
//----------------------------------------------------------------------
diff --git a/include/vki/vki-ppc64-linux.h b/include/vki/vki-ppc64-linux.h
index b4106637b..b82dc377b 100644
--- a/include/vki/vki-ppc64-linux.h
+++ b/include/vki/vki-ppc64-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Julian Seward
+ Copyright (C) 2005-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
@@ -685,6 +685,9 @@ struct vki_ucontext {
struct vki_sigcontext uc_mcontext; /* last for extensibility */
};
+// CAB: TODO
+typedef char vki_modify_ldt_t;
+
//----------------------------------------------------------------------
// From linux-2.6.13/include/asm-ppc64/ipcbuf.h
//----------------------------------------------------------------------
diff --git a/include/vki/vki-s390x-linux.h b/include/vki/vki-s390x-linux.h
index c3f6d0047..8fdeadd1f 100644
--- a/include/vki/vki-s390x-linux.h
+++ b/include/vki/vki-s390x-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright IBM Corp. 2010-2015
+ Copyright IBM Corp. 2010-2017
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -822,6 +822,8 @@ struct vki_ucontext {
vki_sigset_t uc_sigmask; /* mask last for extensibility */
};
+typedef char vki_modify_ldt_t;
+
//----------------------------------------------------------------------
// From linux-2.6.16.60/include/asm-s390/ipcbuf.h
//----------------------------------------------------------------------
diff --git a/include/vki/vki-scnums-amd64-linux.h b/include/vki/vki-scnums-amd64-linux.h
index 820cd021d..adeee0062 100644
--- a/include/vki/vki-scnums-amd64-linux.h
+++ b/include/vki/vki-scnums-amd64-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-scnums-arm-linux.h b/include/vki/vki-scnums-arm-linux.h
index df3572965..4430e6991 100644
--- a/include/vki/vki-scnums-arm-linux.h
+++ b/include/vki/vki-scnums-arm-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2008-2015 Evan Geller
+ Copyright (C) 2008-2017 Evan Geller
gaze@bea.ms
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-scnums-arm64-linux.h b/include/vki/vki-scnums-arm64-linux.h
index e963c4521..d53e7d73c 100644
--- a/include/vki/vki-scnums-arm64-linux.h
+++ b/include/vki/vki-scnums-arm64-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2013-2015 OpenWorks
+ Copyright (C) 2013-2017 OpenWorks
info@open-works.net
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-scnums-darwin.h b/include/vki/vki-scnums-darwin.h
index b77584967..04b42c844 100644
--- a/include/vki/vki-scnums-darwin.h
+++ b/include/vki/vki-scnums-darwin.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2007-2015 Apple Inc.
+ Copyright (C) 2007-2017 Apple Inc.
Greg Parker gparker@apple.com
This program is free software; you can redistribute it and/or
@@ -202,6 +202,10 @@
#define __NR_syscall_thread_switch VG_DARWIN_SYSCALL_CONSTRUCT_MACH(61)
#define __NR_clock_sleep_trap VG_DARWIN_SYSCALL_CONSTRUCT_MACH(62)
+#if DARWIN_VERS >= DARWIN_10_12
+#define __NR_host_create_mach_voucher_trap VG_DARWIN_SYSCALL_CONSTRUCT_MACH(70)
+#endif
+
#define __NR_mach_timebase_info VG_DARWIN_SYSCALL_CONSTRUCT_MACH(89)
#define __NR_mach_wait_until VG_DARWIN_SYSCALL_CONSTRUCT_MACH(90)
#define __NR_mk_timer_create VG_DARWIN_SYSCALL_CONSTRUCT_MACH(91)
@@ -391,8 +395,13 @@
/* 174 old getdents */
/* 175 old gc_control */
#define __NR_add_profil VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(176)
- /* 177 */
- /* 178 */
+
+#if DARWIN_VERS >= DARWIN_10_12
+#define __NR_kdebug_typefilter VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(177)
+#endif /* DARWIN_VERS >= DARWIN_10_12 */
+#if DARWIN_VERS >= DARWIN_10_11
+#define __NR_kdebug_trace_string VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(178)
+#endif /* DARWIN_VERS >= DARWIN_10_11 */
/* 179 */
#define __NR_kdebug_trace VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(180)
#define __NR_setgid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(181)
@@ -642,7 +651,9 @@
/* 372 */
#endif
/* 373 */
- /* 374 */
+#if DARWIN_VERS >= DARWIN_10_11
+#define __NR_kevent_qos VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(374)
+#endif /* DARWIN_VERS >= DARWIN_10_11 */
/* 375 */
/* 376 */
/* 377 */
@@ -706,9 +717,9 @@
#define __NR_audit_session_port VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(432)
#define __NR_pid_suspend VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(433)
#define __NR_pid_resume VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(434)
-
-
-
+ /* 435 */
+ /* 436 */
+ /* 437 */
#define __NR_shared_region_map_and_slide_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(438)
#define __NR_kas_info VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(439)
#define __NR_memorystatus_control VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(440)
@@ -716,7 +727,7 @@
#define __NR_guarded_close_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(442)
#define __NR_guarded_kqueue_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(443)
#define __NR_change_fdguard_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(444)
-
+ /* 445 */
#define __NR_proc_rlimit_control VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(446)
#define __NR_connectx VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(447)
#define __NR_disconnectx VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(448)
@@ -732,35 +743,46 @@
#if DARWIN_VERS >= DARWIN_10_10
#define __NR_necp_match_policy VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(460)
#define __NR_getattrlistbulk VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(461)
+#endif /* DARWIN_VERS >= DARWIN_10_10 */
+
+#if DARWIN_VERS >= DARWIN_10_12
+#define __NR_clonefileat VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(462)
+#endif /* DARWIN_VERS >= DARWIN_10_12 */
+
+#if DARWIN_VERS >= DARWIN_10_10
+#define __NR_faccessat VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(466)
+#define __NR_fstatat64 VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(470)
#define __NR_readlinkat VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(473)
#define __NR_bsdthread_ctl VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(478)
+#define __NR_csrctl VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(483)
#define __NR_guarded_open_dprotected_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(484)
#define __NR_guarded_write_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(485)
#define __NR_guarded_pwrite_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(486)
#define __NR_guarded_writev_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(487)
- /* 488 */
- /* 489 */
#endif /* DARWIN_VERS >= DARWIN_10_10 */
-// TODO Update with OS X 10.11 kernel (xnu) source code release
+#if DARWIN_VERS >= DARWIN_10_12
+#define __NR_renameatx_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(488)
+#endif /* DARWIN_VERS >= DARWIN_10_12 */
+ /* 489 */
+
#if DARWIN_VERS >= DARWIN_10_11
- /* 490 */
- /* 491 */
- /* 492 */
- /* 493 */
- /* 494 */
+#define __NR_netagent_trigger VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(490)
+#define __NR_stack_snapshot_with_config VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(491)
+#define __NR_microstackshot VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(492)
+#define __NR_grab_pgo_data VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(493)
+#define __NR_persona VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(494)
/* 495 */
/* 496 */
/* 497 */
/* 498 */
- /* 499 */
+#define __NR_work_interval_ctl VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(499)
#endif /* DARWIN_VERS >= DARWIN_10_11 */
-// TODO Update with macOS 10.12 kernel (xnu) source code release
#if DARWIN_VERS >= DARWIN_10_12
- /* 500 */
- /* 501 */
- /* 502 */
+#define __NR_getentropy VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(500)
+#define __NR_necp_open VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(501)
+#define __NR_necp_client_action VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(502)
/* 503 */
/* 504 */
/* 505 */
@@ -773,13 +795,13 @@
/* 512 */
/* 513 */
/* 514 */
- /* 515 */
- /* 516 */
- /* 517 */
- /* 518 */
+#define __NR_ulock_wait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(515)
+#define __NR_ulock_wake VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(516)
+#define __NR_fclonefileat VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(517)
+#define __NR_fs_snapshot VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(518)
/* 519 */
- /* 520 */
- /* 521 */
+#define __NR_terminate_with_payload VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(520)
+#define __NR_abort_with_payload VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(521)
#endif /* DARWIN_VERS >= DARWIN_10_12 */
#if DARWIN_VERS < DARWIN_10_6
@@ -795,7 +817,6 @@
#elif DARWIN_VERS == DARWIN_10_11
#define __NR_MAXSYSCALL VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(500)
#elif DARWIN_VERS == DARWIN_10_12
-// TODO Confirm against final release
#define __NR_MAXSYSCALL VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(522)
#else
#error unknown darwin version
diff --git a/include/vki/vki-scnums-mips32-linux.h b/include/vki/vki-scnums-mips32-linux.h
index 5103b43a0..0187e9003 100644
--- a/include/vki/vki-scnums-mips32-linux.h
+++ b/include/vki/vki-scnums-mips32-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2010-2015 RT-RK
+ Copyright (C) 2010-2017 RT-RK
mips-valgrind@rt-rk.com
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-scnums-mips64-linux.h b/include/vki/vki-scnums-mips64-linux.h
index 79cc5537a..e3d8536bd 100644
--- a/include/vki/vki-scnums-mips64-linux.h
+++ b/include/vki/vki-scnums-mips64-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2010-2015 RT-RK
+ Copyright (C) 2010-2017 RT-RK
mips-valgrind@rt-rk.com
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-scnums-ppc32-linux.h b/include/vki/vki-scnums-ppc32-linux.h
index 644ac8a32..c2859ed9c 100644
--- a/include/vki/vki-scnums-ppc32-linux.h
+++ b/include/vki/vki-scnums-ppc32-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Julian Seward
+ Copyright (C) 2005-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-scnums-ppc64-linux.h b/include/vki/vki-scnums-ppc64-linux.h
index 2a2016104..a195c015b 100644
--- a/include/vki/vki-scnums-ppc64-linux.h
+++ b/include/vki/vki-scnums-ppc64-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2005-2015 Julian Seward
+ Copyright (C) 2005-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-scnums-s390x-linux.h b/include/vki/vki-scnums-s390x-linux.h
index 0187045e9..bc436dd68 100644
--- a/include/vki/vki-scnums-s390x-linux.h
+++ b/include/vki/vki-scnums-s390x-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright IBM Corp. 2010-2015
+ Copyright IBM Corp. 2010-2017
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-scnums-solaris.h b/include/vki/vki-scnums-solaris.h
index 2a6b6dea4..f9056abe8 100644
--- a/include/vki/vki-scnums-solaris.h
+++ b/include/vki/vki-scnums-solaris.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2011-2015 Petr Pavlu
+ Copyright (C) 2011-2017 Petr Pavlu
setup@dagobah.cz
This program is free software; you can redistribute it and/or
@@ -28,7 +28,7 @@
The GNU General Public License is contained in the file COPYING.
*/
-/* Copyright 2013-2016, Ivo Raisr <ivosh@ivosh.net>. */
+/* Copyright 2013-2017, Ivo Raisr <ivosh@ivosh.net>. */
/* Copyright 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
@@ -144,7 +144,7 @@
#define __NR_setgroups SYS_setgroups
#define __NR_getgroups SYS_getgroups
#define __NR_sigprocmask SYS_sigprocmask
-//#define __NR_sigsuspend SYS_sigsuspend
+#define __NR_sigsuspend SYS_sigsuspend
#define __NR_sigaltstack SYS_sigaltstack
#define __NR_sigaction SYS_sigaction
#define __NR_sigpending SYS_sigpending
@@ -157,7 +157,7 @@
#define __NR_nfssys SYS_nfssys
#define __NR_waitid SYS_waitid
#define __NR_waitsys SYS_waitsys /* = SYS_waitid (historical) */
-//#define __NR_sigsendsys SYS_sigsendsys
+#define __NR_sigsendsys SYS_sigsendsys
//#define __NR_hrtsys SYS_hrtsys
#if defined(SOLARIS_UTIMESYS_SYSCALL)
#define __NR_utimesys SYS_utimesys
@@ -237,8 +237,7 @@
//#define __NR_brand SYS_brand
//#define __NR_kaio SYS_kaio
//#define __NR_cpc SYS_cpc
-//#define __NR_lgrpsys SYS_lgrpsys
-//#define __NR_meminfosys SYS_meminfosys /* = SYS_lgrpsys */
+#define __NR_lgrpsys SYS_lgrpsys
#define __NR_rusagesys SYS_rusagesys
#define __NR_port SYS_port
#define __NR_pollsys SYS_pollsys
@@ -354,10 +353,8 @@
VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRVTIME)
#define __NR_gethrestime \
VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRESTIME)
-/*
#define __NR_getlgrp \
VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETLGRP)
-*/
#if defined(SOLARIS_GETHRT_FASTTRAP)
#define __NR_gethrt \
VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRT)
diff --git a/include/vki/vki-scnums-x86-linux.h b/include/vki/vki-scnums-x86-linux.h
index a4e75a7da..8a6376b8e 100644
--- a/include/vki/vki-scnums-x86-linux.h
+++ b/include/vki/vki-scnums-x86-linux.h
@@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-solaris-repcache.h b/include/vki/vki-solaris-repcache.h
index e2ad269b3..57f031ee1 100644
--- a/include/vki/vki-solaris-repcache.h
+++ b/include/vki/vki-solaris-repcache.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2015-2016 Ivo Raisr
+ Copyright (C) 2015-2017 Ivo Raisr
ivosh@ivosh.net
This program is free software; you can redistribute it and/or
@@ -28,7 +28,7 @@
The GNU General Public License is contained in the file COPYING.
*/
-/* Copyright 2015-2015, Tomas Jedlicka <jedlickat@gmail.com>. */
+/* Copyright 2015-2017, Tomas Jedlicka <jedlickat@gmail.com>. */
#ifndef __VKI_SOLARIS_REPCACHE_H
#define __VKI_SOLARIS_REPCACHE_H
@@ -343,7 +343,7 @@ enum vki_rep_protocol_requestid {
#error Unsupported repcache protocol version
#endif
-/* The following definitions are currently stable accross all repcache protocol
+/* The following definitions are currently stable across all repcache protocol
versions. If there is any change to them, they need to be versioned
properly so that Valgrind works on older versions. */
diff --git a/include/vki/vki-solaris.h b/include/vki/vki-solaris.h
index 002b2dfa0..5b7bb21c4 100644
--- a/include/vki/vki-solaris.h
+++ b/include/vki/vki-solaris.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2011-2015 Petr Pavlu
+ Copyright (C) 2011-2017 Petr Pavlu
setup@dagobah.cz
This program is free software; you can redistribute it and/or
@@ -28,7 +28,7 @@
The GNU General Public License is contained in the file COPYING.
*/
-/* Copyright 2013-2016, Ivo Raisr <ivosh@ivosh.net> */
+/* Copyright 2013-2017, Ivo Raisr <ivosh@ivosh.net> */
/* Copyright 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
@@ -500,13 +500,14 @@ typedef struct vki_kcf_door_arg_s {
#define VKI_O_LARGEFILE O_LARGEFILE
#define VKI_F_DUPFD F_DUPFD
+#define VKI_F_DUPFD_CLOEXEC F_DUPFD_CLOEXEC
#define VKI_F_GETFD F_GETFD
#define VKI_F_SETFD F_SETFD
#define VKI_F_GETFL F_GETFL
#define VKI_F_GETXFL F_GETXFL
#define VKI_F_SETFL F_SETFL
-/* SVR3 rfs compability const, declared only if _KERNEL or _KMEMUSER is
+/* SVR3 rfs compatibility const, declared only if _KERNEL or _KMEMUSER is
defined. */
#if 0
#define VKI_F_O_GETLK F_O_GETLK
@@ -603,6 +604,26 @@ typedef struct vki_kcf_door_arg_s {
#define vki_semid64_ds semid_ds64
+#include <sys/lgrp_user.h>
+#if defined(HAVE_SYS_LGRP_USER_IMPL_H)
+/* Include implementation specific header file on newer Solaris. */
+#include <sys/lgrp_user_impl.h>
+#endif /* HAVE_SYS_LGRP_USER_IMPL_H */
+#define VKI_LGRP_SYS_MEMINFO LGRP_SYS_MEMINFO
+#define VKI_LGRP_SYS_GENERATION LGRP_SYS_GENERATION
+#define VKI_LGRP_SYS_VERSION LGRP_SYS_VERSION
+#define VKI_LGRP_SYS_SNAPSHOT LGRP_SYS_SNAPSHOT
+#define VKI_LGRP_SYS_AFFINITY_GET LGRP_SYS_AFFINITY_GET
+#define VKI_LGRP_SYS_AFFINITY_SET LGRP_SYS_AFFINITY_SET
+#define VKI_LGRP_SYS_LATENCY LGRP_SYS_LATENCY
+#define VKI_LGRP_SYS_HOME LGRP_SYS_HOME
+#define VKI_LGRP_SYS_AFF_INHERIT_GET LGRP_SYS_AFF_INHERIT_GET
+#define VKI_LGRP_SYS_AFF_INHERIT_SET LGRP_SYS_AFF_INHERIT_SET
+#define VKI_LGRP_SYS_DEVICE_LGRPS LGRP_SYS_DEVICE_LGRPS
+#define VKI_LGRP_SYS_MAXSOCKETS_GET LGRP_SYS_MAXSOCKETS_GET
+#define vki_lgrp_view_t lgrp_view_t
+
+
#include <sys/loadavg.h>
#define VKI_LOADAVG_NSTATS LOADAVG_NSTATS
@@ -642,6 +663,8 @@ typedef struct vki_kcf_door_arg_s {
#define VKI_MC_UNLOCKAS MC_UNLOCKAS
#define VKI_MC_HAT_ADVISE MC_HAT_ADVISE
+#define vki_meminfo_t meminfo_t
+
#include <sys/mntio.h>
#define VKI_MNTIOC_GETEXTMNTENT MNTIOC_GETEXTMNTENT
@@ -813,6 +836,7 @@ typedef struct vki_kcf_door_arg_s {
#define VKI_P_PID P_PID
#define VKI_P_PGID P_PGID
#define VKI_P_ALL P_ALL
+#define VKI_POP_AND POP_AND
#define vki_procset_t procset_t
diff --git a/include/vki/vki-x86-linux.h b/include/vki/vki-x86-linux.h
index 345b8a4a4..12ded916b 100644
--- a/include/vki/vki-x86-linux.h
+++ b/include/vki/vki-x86-linux.h
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2000-2015 Julian Seward
+ Copyright (C) 2000-2017 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
diff --git a/include/vki/vki-xen-domctl.h b/include/vki/vki-xen-domctl.h
index d381ee6cb..9e8b5ef1f 100644
--- a/include/vki/vki-xen-domctl.h
+++ b/include/vki/vki-xen-domctl.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -36,6 +36,8 @@
* - 0x00000008: Xen 4.2
* - 0x00000009: Xen 4.3 & 4.4
* - 0x0000000a: Xen 4.5
+ * - 0x0000000b: Xen 4.6
+ * - 0x0000000c: Xen 4.7
*
* When adding a new subop be sure to include the variants used by all
* of the above, both here and in syswrap-xen.c
@@ -99,6 +101,7 @@
#define VKI_XEN_DOMCTL_debug_op 54
#define VKI_XEN_DOMCTL_gethvmcontext_partial 55
#define VKI_XEN_DOMCTL_mem_event_op 56
+#define VKI_XEN_DOMCTL_vm_event_op 56 /* name change in 4.6 */
#define VKI_XEN_DOMCTL_mem_sharing_op 57
#define VKI_XEN_DOMCTL_disable_migrate 58
#define VKI_XEN_DOMCTL_gettscinfo 59
@@ -116,6 +119,7 @@
#define VKI_XEN_DOMCTL_cacheflush 71
#define VKI_XEN_DOMCTL_get_vcpu_msrs 72
#define VKI_XEN_DOMCTL_set_vcpu_msrs 73
+#define VKI_XEN_DOMCTL_monitor_op 77 /* new in 4.6 */
#define VKI_XEN_DOMCTL_gdbsx_guestmemio 1000
#define VKI_XEN_DOMCTL_gdbsx_pausevcpu 1001
#define VKI_XEN_DOMCTL_gdbsx_unpausevcpu 1002
@@ -351,6 +355,22 @@ struct vki_xen_guest_tsc_info {
typedef struct vki_xen_guest_tsc_info vki_xen_guest_tsc_info_t;
DEFINE_VKI_XEN_GUEST_HANDLE(vki_xen_guest_tsc_info_t);
+struct vki_xen_domctl_tsc_info_00000007 {
+ VKI_XEN_GUEST_HANDLE_64(vki_xen_guest_tsc_info_t) out_info; /* OUT */
+ vki_xen_guest_tsc_info_t info; /* IN */
+};
+
+/* 4.6 removed the output pointer */
+struct vki_xen_domctl_tsc_info_0000000b {
+ /* IN/OUT */
+ vki_uint32_t tsc_mode;
+ vki_uint32_t gtsc_khz;
+ vki_uint32_t incarnation;
+ vki_uint32_t pad;
+ vki_xen_uint64_aligned_t elapsed_nsec;
+};
+
+
struct vki_xen_domctl_hvmcontext {
vki_uint32_t size; /* IN/OUT size of buffer */
VKI_XEN_GUEST_HANDLE_64(vki_uint8) buffer; /* IN/OUT */
@@ -366,10 +386,6 @@ struct vki_xen_domctl_hvmcontext_partial {
typedef struct vki_xen_domctl_hvmcontext_partial vki_xen_domctl_hvmcontext_partial_t;
DEFINE_VKI_XEN_GUEST_HANDLE(vki_xen_domctl_hvmcontext_partial_t);
-struct vki_xen_domctl_tsc_info {
- VKI_XEN_GUEST_HANDLE_64(vki_xen_guest_tsc_info_t) out_info; /* OUT */
- vki_xen_guest_tsc_info_t info; /* IN */
-};
struct vki_xen_domctl_pin_mem_cacheattr {
vki_xen_uint64_aligned_t start, end; /* IN */
@@ -425,22 +441,44 @@ struct vki_xen_domctl_address_size {
vki_uint32_t size;
};
-struct vki_xen_domctl_assign_device {
+/* vki_xen_domctl_assign_device_00000007 is the same up to version 0x0000000b */
+struct vki_xen_domctl_assign_device_00000007 {
vki_uint32_t machine_sbdf; /* machine PCI ID of assigned device */
};
+#define VKI_XEN_DOMCTL_DEV_PCI 0
+#define VKI_XEN_DOMCTL_DEV_DT 1
+struct vki_xen_domctl_assign_device_0000000b {
+ vki_uint32_t dev; /* XEN_DOMCTL_DEV_* */
+ union {
+ struct {
+ vki_uint32_t machine_sbdf; /* machine PCI ID of assigned device */
+ } pci;
+ struct {
+ vki_uint32_t size; /* Length of the path */
+ VKI_XEN_GUEST_HANDLE_64(vki_uint8) path; /* path to the device tree node */
+ } dt;
+ } u;
+ /* IN */
+//#define XEN_DOMCTL_DEV_RDM_RELAXED 1
+ vki_uint32_t flag; /* flag of assigned device */
+};
+
struct vki_xen_domctl_debug_op {
vki_uint32_t op; /* IN */
vki_uint32_t vcpu; /* IN */
};
typedef struct vki_xen_domctl_debug_op vki_xen_domctl_debug_op_t;
-struct vki_xen_domctl_mem_event_op {
+struct vki_xen_domctl_mem_event_op_00000007 {
vki_uint32_t op; /* IN */
vki_uint32_t mode; /* IN */
vki_uint32_t port; /* OUT */
};
+/* only a name change in 4.6 */
+typedef struct vki_xen_domctl_mem_event_op_00000007 vki_xen_domctl_vm_event_op_0000000b;
+
struct vki_xen_domctl_set_access_required {
vki_uint8_t access_required; /* IN */
};
@@ -468,6 +506,76 @@ struct vki_xen_domctl_vcpu_msrs {
VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_vcpu_msr_t) msrs;
};
+#define VKI_XEN_DOMCTL_MONITOR_OP_ENABLE 0
+#define VKI_XEN_DOMCTL_MONITOR_OP_DISABLE 1
+#define VKI_XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES 2
+
+#define VKI_XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG 0
+#define VKI_XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR 1
+#define VKI_XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP 2
+#define VKI_XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT 3
+#define VKI_XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST 4
+
+struct vki_xen_domctl_monitor_op_0000000b {
+ vki_uint32_t op; /* vki_xen_DOMCTL_MONITOR_OP_* */
+
+ /*
+ * When used with ENABLE/DISABLE this has to be set to
+ * the requested vki_xen_DOMCTL_MONITOR_EVENT_* value.
+ * With GET_CAPABILITIES this field returns a bitmap of
+ * events supported by the platform, in the format
+ * (1 << vki_xen_DOMCTL_MONITOR_EVENT_*).
+ */
+ vki_uint32_t event;
+
+ /*
+ * Further options when issuing vki_xen_DOMCTL_MONITOR_OP_ENABLE.
+ */
+ union {
+ struct {
+ /* Which control register */
+ vki_uint8_t index;
+ /* Pause vCPU until response */
+ vki_uint8_t sync;
+ /* Send event only on a change of value */
+ vki_uint8_t onchangeonly;
+ } mov_to_cr;
+
+ struct {
+ /* Enable the capture of an extended set of MSRs */
+ vki_uint8_t extended_capture;
+ } mov_to_msr;
+
+ struct {
+ /* Pause vCPU until response */
+ vki_uint8_t sync;
+ } guest_request;
+ } u;
+};
+
+
+struct vki_xen_domctl_monitor_op {
+ vki_uint32_t op;
+#define VKI_XEN_DOMCTL_MONITOR_OP_ENABLE 0
+#define VKI_XEN_DOMCTL_MONITOR_OP_DISABLE 1
+#define VKI_XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES 2
+#define VKI_XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP 3
+ vki_uint32_t event;
+ union {
+ struct {
+ vki_uint8_t index;
+ vki_uint8_t sync;
+ vki_uint8_t onchangeonly;
+ } mov_to_cr;
+ struct {
+ vki_uint8_t extended_capture;
+ } mov_to_msr;
+ struct {
+ vki_uint8_t sync;
+ } guest_request;
+ } u;
+};
+
struct vki_xen_domctl {
vki_uint32_t cmd;
vki_uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
@@ -499,14 +607,16 @@ struct vki_xen_domctl {
//struct vki_xen_domctl_arch_setup arch_setup;
struct vki_xen_domctl_settimeoffset settimeoffset;
//struct vki_xen_domctl_disable_migrate disable_migrate;
- struct vki_xen_domctl_tsc_info tsc_info;
+ struct vki_xen_domctl_tsc_info_00000007 tsc_info_00000007;
+ struct vki_xen_domctl_tsc_info_0000000b tsc_info_0000000b;
//struct vki_xen_domctl_real_mode_area real_mode_area;
struct vki_xen_domctl_hvmcontext hvmcontext;
struct vki_xen_domctl_hvmcontext_partial hvmcontext_partial;
struct vki_xen_domctl_address_size address_size;
//struct vki_xen_domctl_sendtrigger sendtrigger;
//struct vki_xen_domctl_get_device_group get_device_group;
- struct vki_xen_domctl_assign_device assign_device;
+ struct vki_xen_domctl_assign_device_00000007 assign_device_00000007;
+ struct vki_xen_domctl_assign_device_0000000b assign_device_0000000b;
//struct vki_xen_domctl_bind_pt_irq bind_pt_irq;
//struct vki_xen_domctl_memory_mapping memory_mapping;
//struct vki_xen_domctl_ioport_mapping ioport_mapping;
@@ -516,7 +626,8 @@ struct vki_xen_domctl {
//struct vki_xen_domctl_set_target set_target;
//struct vki_xen_domctl_subscribe subscribe;
struct vki_xen_domctl_debug_op debug_op;
- struct vki_xen_domctl_mem_event_op mem_event_op;
+ struct vki_xen_domctl_mem_event_op_00000007 mem_event_op_00000007;
+ vki_xen_domctl_vm_event_op_0000000b vm_event_op_0000000b;
//struct vki_xen_domctl_mem_sharing_op mem_sharing_op;
#if defined(__i386__) || defined(__x86_64__)
struct vki_xen_domctl_cpuid cpuid;
@@ -532,6 +643,7 @@ struct vki_xen_domctl {
struct vki_xen_domctl_cacheflush cacheflush;
//struct vki_xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
//struct vki_xen_domctl_gdbsx_domstatus gdbsx_domstatus;
+ struct vki_xen_domctl_monitor_op_0000000b monitor_op_0000000b;
vki_uint8_t pad[128];
} u;
};
diff --git a/include/vki/vki-xen-evtchn.h b/include/vki/vki-xen-evtchn.h
index d8ff600a2..9d4e4c3a6 100644
--- a/include/vki/vki-xen-evtchn.h
+++ b/include/vki/vki-xen-evtchn.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-gnttab.h b/include/vki/vki-xen-gnttab.h
index 11c4219f6..3e6c36cdb 100644
--- a/include/vki/vki-xen-gnttab.h
+++ b/include/vki/vki-xen-gnttab.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-hvm.h b/include/vki/vki-xen-hvm.h
index 0664b73de..0c34570b6 100644
--- a/include/vki/vki-xen-hvm.h
+++ b/include/vki/vki-xen-hvm.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-memory.h b/include/vki/vki-xen-memory.h
index c3076902d..3b6f9e519 100644
--- a/include/vki/vki-xen-memory.h
+++ b/include/vki/vki-xen-memory.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-mmuext.h b/include/vki/vki-xen-mmuext.h
index 5e758b391..817269c65 100644
--- a/include/vki/vki-xen-mmuext.h
+++ b/include/vki/vki-xen-mmuext.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-physdev.h b/include/vki/vki-xen-physdev.h
index d3111a091..6f8c2c84c 100644
--- a/include/vki/vki-xen-physdev.h
+++ b/include/vki/vki-xen-physdev.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-schedop.h b/include/vki/vki-xen-schedop.h
index 30f8a33a5..3c5b2ceeb 100644
--- a/include/vki/vki-xen-schedop.h
+++ b/include/vki/vki-xen-schedop.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-tmem.h b/include/vki/vki-xen-tmem.h
index e372ae6d8..bc51f934e 100644
--- a/include/vki/vki-xen-tmem.h
+++ b/include/vki/vki-xen-tmem.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-version.h b/include/vki/vki-xen-version.h
index a022c94dc..dfaf7c07e 100644
--- a/include/vki/vki-xen-version.h
+++ b/include/vki/vki-xen-version.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen-x86.h b/include/vki/vki-xen-x86.h
index a54a4de9a..a26b3ea8a 100644
--- a/include/vki/vki-xen-x86.h
+++ b/include/vki/vki-xen-x86.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -270,6 +270,19 @@ struct vki_hvm_hw_cpu {
VKI_DECLARE_HVM_SAVE_TYPE(CPU, 2, struct vki_hvm_hw_cpu);
+struct vki_hvm_hw_mtrr {
+#define VKI_MTRR_VCNT 8
+#define VKI_NUM_FIXED_MSR 11
+ vki_uint64_t msr_pat_cr;
+ /* mtrr physbase & physmask msr pair*/
+ vki_uint64_t msr_mtrr_var[VKI_MTRR_VCNT*2];
+ vki_uint64_t msr_mtrr_fixed[VKI_NUM_FIXED_MSR];
+ vki_uint64_t msr_mtrr_cap;
+ vki_uint64_t msr_mtrr_def_type;
+};
+
+VKI_DECLARE_HVM_SAVE_TYPE(MTRR, 14, struct vki_hvm_hw_mtrr);
+
#endif // __VKI_XEN_H
/*--------------------------------------------------------------------*/
diff --git a/include/vki/vki-xen-xsm.h b/include/vki/vki-xen-xsm.h
index b8eb50db3..2e4b17f5d 100644
--- a/include/vki/vki-xen-xsm.h
+++ b/include/vki/vki-xen-xsm.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
diff --git a/include/vki/vki-xen.h b/include/vki/vki-xen.h
index 924a1e9c9..c0dfee36b 100644
--- a/include/vki/vki-xen.h
+++ b/include/vki/vki-xen.h
@@ -2,7 +2,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2012-2015 Citrix
+ Copyright (C) 2012-2017 Citrix
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as