510 Commits

Author SHA1 Message Date
Rhys Kidd
4848781351 Fix clang/osx: ld: warning: -read_only_relocs cannot be used with x86_64
bz#349769


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15450
2015-07-25 05:50:10 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Julian Seward
45a0fb5e69 Allow the user to specify precise-exception behaviour for translations
made from file-backed mappings (AOT code, basically) that is different
from the default behaviour as specified by --vex-iropt-register-updates.

New flag is --px-file-backed=, with the same possible args as
--vex-iropt-register-updates has.

Add a new flag --px-default, which is a short alias for
--vex-iropt-register-updates.

Add one line of stats output when --stats=yes, showing counts of how
many translations have been made under each of the 4 different PX
optimisation settings.

No user-visible change if you don't use the new flags.

Relies on VEX API change in r3084.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14906
2015-02-05 12:59:46 +00:00
Florian Krohm
a9aa079113 Change most remaining use of Addr64 in coregrind and the tools to Addr.
Tracking VEX r3056.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14846
2015-01-04 17:20:45 +00:00
Florian Krohm
e7ed65a9f3 Track the IMark changes in VEX r3055.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14844
2015-01-02 17:32:40 +00:00
Florian Krohm
115f5cd399 Simplify the VG_(get_filename_linenum) interface by removing
the dirname_available parameter. It's redundant. The value
of the returned directory name can be tested instead.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14814
2014-12-16 20:55:58 +00:00
Florian Krohm
f7c5c06c5d Add limited support for printing floating point numbers to
VG_(debugLog_vprintf). 
Remove function VG_(percentify) and fix up its call sites (part of
fixing BZ #337869.
Allow the width in a format specification to be '*', i.e. the width is
given as an additional function argument.

The limitations for printing floating point numbers are:
(1) %f is the only supported format. Width and precision can be
    specified.
(2) Funny numbers (NaN and such) are not supported.
(3) Floating point numbers need to be benign in the sense that their
    integral part fits into an ULong.
This is good enough for our purposes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14806
2014-12-12 19:32:10 +00:00
Florian Krohm
69d42e3d4b Fix BZ 334802. Patch by Mark Wielaard with a few mods to make it apply.
r14794 is related as well.
Also: remove -Wno-format-zero-length from compile options.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14795
2014-11-29 14:41:32 +00:00
Florian Krohm
645563670a Merge revisions 14222, 14268, and 14270 from the BUF_REMOVAL branch to trunk.
Assorted fixes in exp-bbv to eliminate a few buffers.
Implement a suggestion found in the massif source, namely to add the
equivalent of fprintf to m_libcprint. Good suggestion. Thusly
- VgFile: similar to FILE; buffered output, 8k buffer
- VG_(fopen): similar to fopen, but with arguments as in VG_(open)
- VG_(fprintf) and VG_(vfprintf): like [v]fprintf with VgFile 1at argument
- VG_(fclose)
Change massif, exp-bbv and cachegrind to use this functionality.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14678
2014-10-30 22:17:56 +00:00
Florian Krohm
361d6801e1 When traversing VG_(args_for_client) there is no need to check
the array element for NULL. Function VG_(split_up_argv), which
sets up that array, ensures that no element is NULL.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14671
2014-10-28 20:28:32 +00:00
Florian Krohm
f60b16db61 Merge revisions 14356-14358 from the BUF_REMOVAL branch to trunk.
Rewrite cg_merge.c to avoid fixed size arrays.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14669
2014-10-27 22:03:47 +00:00
Florian Krohm
d7cc7eac99 Merge revisions 14255, 14293, and 14294 from the BUF_REMOVAL branch to trunk.
The functions VG_(get_filename) and VG_(get_filename_lineno) now return
a pointer to filename and directory name instead of copying them into
buffers passed in from the caller.
The returned strings are persistent as long as the DebugInfo to which
they belong is not discarded. The caller therefore needs to stash them
away as needed.
Function VG_(strncpy_safely) has been removed as it is no longer needed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14668
2014-10-27 12:06:35 +00:00
Florian Krohm
08e13c218d Merge r14288 from the BUF_REMOVAL branch to trunk.
What it does it changing cachegrind's get_debug_info function such
that it no longer builds up an absolute pathname. Instead the function
get an additional parameter for the directory name and the absolute
pathname is built when it is needed. This will come in handy soonish
when VG_(get_filename_lineno) will be changed and those buffers will
disappear.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14665
2014-10-26 17:12:12 +00:00
Florian Krohm
665280aeaf Merge r14202 from the BUF_REMOVAL branch to trunk.
This patch changes the interface and behaviour of VG_(demangle) and
VG_(maybe_Z_demangle). Instead of copying the demangled name into a
fixed sized buffer that is passed in from the caller (HChar *buf, Int n_buf),
the demangling functions will now return a pointer to the full-length
demangled name (HChar **result). It is the caller's responsiblilty to
make a copy if needed. 

This change in function parameters ripples upward
- first: to get_sym_name
- then to the convenience wrappers
  - VG_(get_fnname)
  - VG_(get_fnname_w_offset)
  - VG_(get_fnname_if_entry)
  - VG_(get_fnname_raw)
  - VG_(get_fnname_no_cxx_demangle)
  - VG_(get_datasym_and_offset)

The changes in foComplete then forces the arguments of
  - VG_(get_objname) to be changed as well

There are some issues regarding the ownership and persistence of
character strings to consider.
In general, the returned character string is owned by "somebody else"
which means the caller must not free it. Also, the caller must not 
modify the returned string as it possibly points to read only memory.
Additionally, the returned string is not necessarily persistent. Here are
the scenarios:
- the returned string is a demangled function name in which case the
  memory holding the string will be freed when the demangler is called again.
- the returned string hangs off of a DebugInfo structure in which case
  it will be freed when the DebugInfo is discarded
- the returned string hangs off of a segment in the address space manager
  in which case it may be overwritten when the segment is merged with
  another segment
So the rule of thunb here is: if in doubt strdup the string.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14664
2014-10-25 19:20:38 +00:00
Florian Krohm
cd357d71b4 Merge six easy pieces from the BUF_REMOVAL branch:
r14271  Audit a few buffer sizes, increase one.
r14280  Audit buffer size.
r14296  Remove a few unneeded header files.
r14310  Replace fixed size buffers with a large enough buffers.
r14338  Remove a dead assignment in print_bbcs and make global variable
        print_fd a local variable.
r14359  Remove a benign macro redefinition in cachegrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14595
2014-09-30 22:15:05 +00:00
Florian Krohm
e383c673dd Ripple from constifying parameters of instrumentation functions and
callbacks from VexTranslateArgs. See VEX r2958.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14564
2014-09-24 12:06:55 +00:00
Mark Wielaard
d5e8b1f68f Old STABS code is still being compiled, but never used. Remove it.
Since valgrind 3.9.0 the STABS support was already disabled completely.
But the code was still there being compiled and we were still searching
for stabs sections in binaries. Completely remove all sources, tests and
references. Add a note to coregrind/m_debuginfo/README.txt to mention
the old code can be found in the subversion repository.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14550
2014-09-18 12:24:53 +00:00
Florian Krohm
bfb5d3fc36 Remove some unneded checks as identified by IBM's BEAM checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14518
2014-09-11 22:15:39 +00:00
Philippe Waroquiers
596f3836e4 update callgrind and cachegrind filtering logic following rev 14469
rev 14469 gives better description of the tweak done to the
simulated cache. Update filtering logic to filter this (variable) tweaking
msg.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14486
2014-09-07 12:15:52 +00:00
Julian Seward
ff3581f0d2 maybe_tweak_LLc: generalise this so that it can mash more or less any
cache size and associativity pair into something the simulator can
actually handle, by increasing the associativity whilst reducing the
number of sets, so that the number of sets becomes a power of two.
Fixes #333501.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14469
2014-09-05 19:05:20 +00:00
Florian Krohm
3aa58402fa Avoid memory leak.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14429
2014-09-02 11:38:09 +00:00
Florian Krohm
75e1c18929 Clean up confusion about VG_(args_the_exename) which was believed to
possibly be NULL in several places. Nowadays, VG_(ii_create_image) will
terminate the process if VG_(args_the_exename) is NULL.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14323
2014-08-20 21:04:14 +00:00
Florian Krohm
6897bf8d8b Remove benign macro redefinition.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14269
2014-08-13 14:31:04 +00:00
Carl Love
914f75de32 This commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334834 and 334836.  The commit does not have a VEX commit associated with it.

POWER PC, add initial Little Endian support

The IBM POWER processor now supports both Big Endian and Little Endian.
This patch renames the #defines with the name ppc64 to ppc64be for the BE
specific code.  This patch adds the Little Endian #define ppc64le to the

Additionally, a few functions are renamed to remove BE from the name if the
function is used by BE and LE. Functions that are BE specific have BE put
in the name.

The goals of this patch is to make sure #defines, function names and
variables consistently use PPC64/ppc64 if it refers to BE and LE,
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
specific.  The patch does not break the code for PPC64 Big Endian.

The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
and tests/power_insn_available.c are also updated to the new #define
definition for PPC64 BE.

Signed-off-by: Carl Love <carll@us.ibm.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14238
2014-08-07 23:17:29 +00:00
Florian Krohm
7aefdaa6ef Update the copyright notice in files ending in '.in' because the
script change-copyright-year did not handle them.
Update the script as well.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14087
2014-06-23 19:33:45 +00:00
Mark Wielaard
a1513e0348 Revert "Tools should explain why an option is bad when using fmsg_bad_option."
This reverts valgrind svn r13975. This was a work in progress, still being
discussed in bug #334802. It should not yet been pushed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13978
2014-05-16 22:38:46 +00:00
Mark Wielaard
1418e68e22 Tools should explain why an option is bad when using fmsg_bad_option.
Add an explanation of why an option was bad to fmsg_bad_option calls that
were just using "" as argument. Fixes bug #334802.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13975
2014-05-16 22:28:42 +00:00
Julian Seward
3f6d211236 Add support for ARMv8 AArch64 (the 64 bit ARM instruction set).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13770
2014-01-12 12:54:00 +00:00
Julian Seward
dbf9b63605 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658
2013-10-18 14:27:36 +00:00
Julian Seward
5d7649ffe9 Rename cg-arch.c to cg_arch.c so as to be consistent with other
filenames, including cg_arch.h :)  No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13527
2013-09-03 08:39:28 +00:00
Mark Wielaard
7d4cc60c1f Bug 321730 Add cg_merge and cg_diff man pages.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13442
2013-07-03 10:00:17 +00:00
Mark Wielaard
b81e3c86b6 Fix double 'the the' in documentation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13363
2013-04-05 13:19:12 +00:00
Philippe Waroquiers
0e086ed3b1 Fix 316145 - callgrind command line options in manpage reference (unknown) callgrind manual
Patch by Mark Wielaard.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13324
2013-03-10 16:29:02 +00:00
Petar Jovanovic
5dd4c02e39 mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
The change corresponds to r2687 in VEX.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292
2013-02-27 23:17:33 +00:00
Florian Krohm
c826b773d4 Fix statement order. Found by Coverity's checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13241
2013-01-19 02:27:41 +00:00
Julian Seward
661c1c2b7b Merge, from branches/COMEM, revisions 13139 to 13235.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13236
2013-01-17 14:24:35 +00:00
Florian Krohm
d62fe23131 Fix two memory leaks. Spotted by Coverity.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13234
2013-01-16 03:18:19 +00:00
Julian Seward
d8f44a112c Teach Cachegrind about IRLoadG and IRStoreG.
git-svn-id: svn://svn.valgrind.org/valgrind/branches/COMEM@13194
2012-12-21 10:34:08 +00:00
Josef Weidendorfer
840c6d8437 Before LL, instrument outstanding helper calls.
Callgrind, Cachegrind, and Lackey call
helpers for memory accesses in bunches, to reduce
register save/restore overhead (and merge load/store
within same instruction into a "modify" event).

The calls should not be done within a RMW section
enclosed by LL/SC instructions, as this reduces the
chance of SC to succeed, and can result in hangs.
For Callgrind, this definitly helped MIPS, and was
committed in r13136. Do the same for Cachegrind/Lackey.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13143
2012-11-26 18:16:58 +00:00
Florian Krohm
e7f4d4f57f Fix some casts that removed const-ness as pointed out by
GCC's -Wcast-qual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13138
2012-11-24 19:41:54 +00:00
Florian Krohm
af66466ce4 Changes to allow compilation with -Wwrite-strings. That compiler option
is not used for testcases, just for valgrind proper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13137
2012-11-23 16:17:43 +00:00
Florian Krohm
d0aa69c331 Fix more Char/HChar mixups. Closing in...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13119
2012-11-10 22:29:54 +00:00
Christian Borntraeger
ad1814e451 s390x machines z196 and zec12 have 4 levels of caches. Adopt the test suite
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13106
2012-11-07 07:57:01 +00:00
Josef Weidendorfer
ca4eecd8d2 Cachegrind: introduce special case for Ir
Because most Ir accesses touch only one line, and this
can be detected at instrumentation time, use a special
handler for that. This handler does not need to check
cache line crossing at runtime.

This does not change the results of the simulator at all,
but improves runtime by around 15% on perf benchmarks.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13095
2012-10-30 00:28:29 +00:00
Josef Weidendorfer
9309e156a7 Get rid of compiler warning
In addition to "__attribute__((always_inline))", gcc wants
"__inline__" to be used, otherwise the warning

  warning: always_inline function might not be inlinable

is printed. However, this does not have any effect on
performance (probably "static" makes gcc 4.7 already inlining
the functions?).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13092
2012-10-29 21:28:03 +00:00
Florian Krohm
5337376bf2 More Char/HChar fixes and constification.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13088
2012-10-27 18:39:11 +00:00
Florian Krohm
4d2d9aca2d Fix a few Char/HChar mixups for cachegrind.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13068
2012-10-21 02:39:42 +00:00
Philippe Waroquiers
3ba803f746 Follow-up to cache reorg: update trace cache warning
Update trace cache warning so that it is the same as before the cache reorg
(avoid failure of some tests on Pentium4 as the warning output
must match what is filtered by cachegrind/tests/filter_stderr)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13060
2012-10-20 17:18:35 +00:00
Florian Krohm
8a6563f826 Issue warning about missing L2 cache only if there are any
caches in the first place.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13058
2012-10-19 03:20:37 +00:00
Florian Krohm
52cb6c14fa Change cache detection for x86/amd64 to fill in VexCacheInfo directly.
New function write_cache_info to dump what was detected for debugging
purposes. 
New function cache_info_is_sensible to ensure that autodetected
cache info lives up to the promises made in libvex.h.
Moved the trace-cache related kludgery to cachegrind where it belongs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13053
2012-10-18 03:16:45 +00:00