42 Commits

Author SHA1 Message Date
Mark Wielaard
461cc5c003 Cleanup GPL header address notices by using http://www.gnu.org/licenses/
Sync VEX/LICENSE.GPL with top-level COPYING file. We used 3 different
addresses for writing to the FSF to receive a copy of the GPL. Replace
all different variants with an URL <http://www.gnu.org/licenses/>.

The following files might still have some slightly different (L)GPL
copyright notice because they were derived from other programs:

- files under coregrind/m_demangle which come from libiberty:
  cplus-dem.c, d-demangle.c, demangle.h, rust-demangle.c,
  safe-ctype.c and safe-ctype.h
- coregrind/m_demangle/dyn-string.[hc] derived from GCC.
- coregrind/m_demangle/ansidecl.h derived from glibc.
- VEX files for FMA detived from glibc:
  host_generic_maddf.h and host_generic_maddf.c
- files under coregrin/m_debuginfo derived from LZO:
  lzoconf.h, lzodefs.h, minilzo-inl.c and minilzo.h
- files under coregrind/m_gdbserver detived from GDB:
  gdb/signals.h, inferiors.c, regcache.c, regcache.h,
  regdef.h, remote-utils.c, server.c, server.h, signals.c,
  target.c, target.h and utils.c

Plus the following test files:

- none/tests/ppc32/testVMX.c derived from testVMX.
- ppc tests derived from QEMU: jm-insns.c, ppc64_helpers.h
  and test_isa_3_0.c
- tests derived from bzip2 (with embedded GPL text in code):
  hackedbz2.c, origin5-bz2.c, varinfo6.c
- tests detived from glibc: str_tester.c, pth_atfork1.c
- test detived from GCC libgomp: tc17_sembar.c
- performance tests derived from bzip2 or tinycc (with embedded GPL
  text in code): bz2.c, test_input_for_tinycc.c and tinycc.c
2019-05-26 20:07:51 +02:00
Philippe Waroquiers
081c34ea47 Fix Bug 404638 - Add VG_(replaceIndexXA)
Based on a patch from Łukasz Marek.

Note that this function differs from:
   *(T*)VG_(indexXA)(arr, index) = new_value;
as the function will mark the array as unsorted.

Note that this function is currently unused in the current valgrind code basis,
but it is useful for tools outside of valgrind tree.
2019-03-16 12:11:39 +01:00
Philippe Waroquiers
7d84a435a8 Fix 383275 - massif valgrind: m_xarray.c:162 (ensureSpaceXA): Assertion '!xa->arr' failed
When a massif xtree snapshot is taken when no allocation was done,
the xtree contains no exe context.
The data structure ips_order_xecu is then szied to 0 using VG_(hintSizeXA).
m_xarray.c then allocates an empty array, while later on, a zero size
is expected to correspond to no allocated array.

Fix the problem in m_xarray.c, by not doing any allocation if the
size hint is 0.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16469
2017-08-08 19:52:03 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Philippe Waroquiers
471900460d Add typedef Alloc_Fn_t/Free_Fn_t in pub_tool_basics.h, use them everywhere
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16138
2016-11-18 21:54:09 +00:00
Philippe Waroquiers
b86956b6b9 Add VG_(strIsMemberXA) in pub_tool_xarray.h
This allows to search more efficiently a string in an xarray of string.
(support work for xtree)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16122
2016-11-11 13:55:07 +00:00
Julian Seward
adc2dafee9 Update copyright dates, to include 2015. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15577
2015-08-21 11:32:26 +00:00
Florian Krohm
038bb9a321 Add a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15493
2015-08-05 13:25:58 +00:00
Philippe Waroquiers
9ff2933592 avoid warning
m_xarray.c:133:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

(I have double checked that passing a negative argument makes the 
assert fail)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15232
2015-05-14 21:26:36 +00:00
Philippe Waroquiers
a13ea37999 Add back vg_assert(xa); that was removed by error in r15211
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15215
2015-05-11 21:02:00 +00:00
Philippe Waroquiers
73266b0930 Micro-optimisation following helgrind secmap gc
Checking the range in indexXA can be done with one comparison.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15211
2015-05-11 19:41:43 +00:00
Philippe Waroquiers
4256a17920 This patch adds a function that allows to directly properly size an xarray
when the size is known in advance.

3 places identified where this function can be used trivially.

The result is a reduction of 'realloc' operations in core
arena, and a small reduction in ttaux arena
(it is the nr of operations that decreases, the memory usage itself
stays the same (ignoring some 'rounding' effects).

E.g. for perf/bigcode 0, we change from
  core 1085742/ 216745904 totalloc-blocks/bytes,     1085733 searches
  ttaux 5348/   6732560 totalloc-blocks/bytes,        5326 searches
to
  core 712666/ 190998592 totalloc-blocks/bytes,      712657 searches
  ttaux 5319/   6731808 totalloc-blocks/bytes,        5296 searches

For bz2, we switch from
  core 50285/  32383664 totalloc-blocks/bytes,       50256 searches
  ttaux 670/    245160 totalloc-blocks/bytes,         669 searches
to
  core 32564/  29971984 totalloc-blocks/bytes,       32535 searches
  ttaux 605/    243280 totalloc-blocks/bytes,         604 searches

Performance wise, on amd64, this improves memcheck performance
on perf tests by 0.0, 0.1 or 0.2 seconds depending on the test.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15173
2015-05-01 16:46:38 +00:00
Florian Krohm
aa351c61c1 Constify.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14641
2014-10-18 20:56:13 +00:00
Florian Krohm
c88dc7f039 Tidy up m_xarray.c.
VG_(newXA) and VG_(cloneXA) never return NULL. Remove pointless asserts.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14539
2014-09-15 18:50:17 +00:00
Julian Seward
d410da3564 Add client requests
VALGRIND_DISABLE_ADDR_ERROR_REPORTING_IN_RANGE and
   VALGRIND_ENABLE_ADDR_ERROR_REPORTING_IN_RANGE
and supporting machinery for managing whole-address-space sparse
mappings.  n-i-bz.  In support of
https://bugzilla.mozilla.org/show_bug.cgi?id=970643



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13884
2014-03-20 23:00:09 +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
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
25b18b0aa1 Char/HChar and constness fixes. Mostly cost center
on allocators which is always a const HChar *


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13089
2012-10-27 23:07:42 +00:00
Julian Seward
4a3633e266 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843
2012-08-05 15:46:46 +00:00
Julian Seward
8b6f93641c Add translation chaining support for amd64, x86 and ARM
(Valgrind side).  See #296422.



git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12484
2012-04-02 21:56:03 +00:00
Julian Seward
c96096ab24 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206
2011-10-23 07:32:08 +00:00
Bart Van Assche
71a513f01a Format functions: change format specifier %t into %pS. Remove the _no_f_c formatting function variants.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12108
2011-10-06 19:08:37 +00:00
Julian Seward
3e9f7836c5 Merge the contents of the HGDEV2 branch into trunk:
* performance and scalability improvements
* show locks held by both threads in a race
* show all 4 locks involved in a lock order violation
* better delimited error messages



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11824
2011-06-24 10:09:41 +00:00
Julian Seward
62134f346f Back out r11568 (Add a new constructor for empty XArrays,
VG_(newSizedXA)) since r11571 removes the only use of the
functionality that r11568 introduces.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11573
2011-02-27 23:53:32 +00:00
Julian Seward
0c2371837b Add a new constructor for empty XArrays, VG_(newSizedXA). This is
identical to VG_(newXA) but allows passing in a size hint.  In the
case where the likely final size of the XArray is known at creation
time, this allows avoiding the repeated (implicit) resizing and
copying of the array as elements are added, which can save a vast
amount of dynamic memory allocation turnover.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11568
2011-02-23 13:22:24 +00:00
Julian Seward
d4a18f87cc Add a method to get the contents of an XArray so we can index in
it really fast, or iterate over it.  This is dangerous and breaks
the nice abstraction (sigh).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11122
2010-05-05 09:23:41 +00:00
Julian Seward
9b0574dff8 Update copyright dates to 2010.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121
2010-05-03 21:37:12 +00:00
Julian Seward
5b1edb07f6 When generating XML output for suppressions, print the suppression
both wrapped up in XML tags (as before) but also in plain text in a
sequence of CDATA blocks.  Normally only one, but in the worst case
the raw data will have ]]> in it, in which case it needs to be split
across two CDATA blocks.

This apparently simple change involved a lot of refactoring of the
suppression printing machinery:

* in the core-tool iface, change "print_extra_suppression_info" (which
  prints any auxiliary info) to "get_extra_suppression_info", which
  parks the text in a caller-supplied buffer.  Adjust tools to match.

* VG_(apply_StackTrace): accept a void* argument, which is passed to
  each invokation of the functional parameter (a poor man's closure
  implementation).

* move PRINTF_CHECK into put_tool_basics.h, where it should have been
  all along

* move private printf-into-an-XArray-of-character functions from
  m_debuginfo into m_xarray, and make them public

* gen_suppression itself: use all the above changes.  Basically we
  always generate the plaintext version into an XArray.  In text mode
  that's just printed.  In XML mode, we print the XMLery as before,
  but the plaintext version is dumped into a CDATA block too.

* update the Protocol 4 specification to match all this.

This still isn't 100% right in the sense that the CDATA block data
needs to be split across multiple blocks if it should ever contain the
CDATA end mark "]]>".  The Protocol 4 spec has this right even though
the implementation currently doesn't.

Fixes #191189.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10822
2009-08-15 22:41:51 +00:00
Julian Seward
5653b12bb2 New methods in WordXA:
* lookupXA_UNSAFE -- binary search in array without being forced
  to sortXA it first -- dangerous because if the array isn't in order
  then the lookup can loop forever

* dropHeadXA -- drop the first N elements (kinda like dropTailXA, but
  unfortunately O(N) not O(1)), so that xarrays can be used to
  implement FIFOs, after a fashion.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10583
2009-07-24 08:11:39 +00:00
Nicholas Nethercote
2001629c3f Updated copyright years.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344
2009-03-10 22:02:09 +00:00
Julian Seward
35c28b721f Merge Helgrind from branches/YARD into the trunk. Also includes some
minor changes to make stack unwinding on amd64-linux approximately
twice as fast as it was before.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8707
2008-10-25 16:22:41 +00:00
Julian Seward
335992d8fc Merge all remaining changes from branches/PTRCHECK. These are some
relatively minor extensions to m_debuginfo, a major overhaul of
m_debuginfo/readdwarf3.c to get its space usage under control, and
changes throughout the system to enable heap-use profiling.

The majority of the merged changes were committed into
branches/PTRCHECK as the following revs: 8591 8595 8598 8599 8601 and
8161.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8621
2008-09-18 18:12:50 +00:00
Julian Seward
6136f591ba Try and bit a bit more space-economical, by increasing the
average loading factor from 0.75 to 0.83, and by being more
careful in VG_(cloneXA).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8539
2008-08-22 23:16:06 +00:00
Julian Seward
9d24c252e1 Make VG_(addToXA) and VG_(addBytesToXA) 64-bit clean.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8525
2008-08-19 08:57:49 +00:00
Julian Seward
14af4957fc Merge in the DATASYMS branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7540
2008-03-03 01:35:41 +00:00
Julian Seward
5679a22410 Update copyright dates ("200X-2007" --> "200X-2008").
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398
2008-02-11 11:34:59 +00:00
Julian Seward
2cf4a1813a Fix silly bug.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6786
2007-08-28 05:19:16 +00:00
Nicholas Nethercote
742ae56613 Remove duplicate code -- make XArray use VG_(ssort).
Had to change XArray's comparison function to return an Int rather than a
Word so it's consistent with the rest of the world.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6680
2007-03-28 01:27:05 +00:00
Julian Seward
0a28307fca VG_(addToXA): return index in the array where the item was added.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6619
2007-02-27 16:40:53 +00:00
Julian Seward
e34b7496c6 Make all the m_xarray functions tool-visible.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6615
2007-02-25 15:04:40 +00:00
Julian Seward
804c7868a1 Expandable arrays of arbitrary element type T are a simple, useful
abstraction implemented independently in several places in the code
base (bad!).  This commit moves into public view a generic
implementation of it which has been lurking in readxcoff.c for some
time.  Currently nothing uses it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6614
2007-02-25 11:51:13 +00:00