62 Commits

Author SHA1 Message Date
Philippe Waroquiers
4c9052b4d6 fix incorrect lineno in supp error msgs+ -v give filename+lineno of used supp.
If a suppression file contains an error, the lineno reported could be wrong.
Also, give filename and lineno of the used suppressions in -v debugging output.

The fix consists in ensuring that tool specific read_extra function gets
the Int* lineno pointer, together with other VG_(get_line) parameters.






git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13469
2013-07-22 22:00:13 +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
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
79b79d6388 First round of Char/HChar fixups for coregrind and memcheck.
Little bit of ripple in tools, too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13074
2012-10-21 19:43:43 +00:00
Florian Krohm
a5928d2ac8 Fix some more Char / HChar mixups
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13042
2012-10-14 16:45:23 +00:00
Florian Krohm
7d59048401 This is the 2nd installment of the cache info reorganisation.
The host's VexArchInfo is passed to the tool instrumentation
functions. Purely mechanic patch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13031
2012-10-07 21:59: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
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
Nicholas Nethercote
11f94ef626 Make error messages at start-up more consistent. Every line of such
messages now begin with "valgrind: ", and they're more often printed before
the preamble.  This required introducing a new message kind, Vg_FailMsg, and
functions VG_(fmsg) and VG_(fmsg_bad_option), and removing
VG_(err_bad_option).

Where we used to have horrible output like this:

    [ocean:~/grind/ws2] vg5 --tool=massif --threshold=101 date
    ==31877== Massif, a heap profiler
    ==31877== Copyright (C) 2003-2010, and GNU GPL'd, by Nicholas Nethercote
    ==31877== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
    ==31877== Command: date
    ==31877== 
    ==31877== --threshold must be between 0.0 and 100.0
    valgrind: Bad option '--threshold'; aborting.
    valgrind: Use --help for more information.

We now have nice output like this:

    [ocean:~/grind/ws2] vg2 --tool=massif --threshold=101 date
    valgrind: Bad option: --threshold=101
    valgrind: --threshold must be between 0.0 and 100.0
    valgrind: Use --help for more information or consult the user manual.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11209
2010-07-06 04:05:23 +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
Nicholas Nethercote
df02ee0eb8 Clarify a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10641
2009-07-27 22:21:22 +00:00
Nicholas Nethercote
68efb29503 A fix for bug 186796: suppression symbol names were being truncated if they
were longer than 200 chars.  Now dynamic memory is used and so they can be
arbitrarily long in theory, although in practice it bombs out at 100,000 for
sanity purposes.  This required adjusting the core/tool interface for
read_extra_suppression_info().  


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10581
2009-07-24 07:38:29 +00:00
Julian Seward
22ec466157 Merge include/ changes from branches/MESSAGING_TIDYUP r10464.
See trunk r10465 commit message for details.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10476
2009-07-15 14:52:18 +00:00
Julian Seward
3109865279 Merge in branches/DCAS.
This branch adds proper support for atomic instructions, proper in the
sense that the atomicity is preserved through the compilation
pipeline, and thus in the instrumented code.

These changes track the IR changes added by vex r1901.  They primarily
update the instrumentation functions in all tools to handle the
changes, with the exception of exp-ptrcheck, which needs some further
work in order to be able to run threaded code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10392
2009-07-01 08:10:49 +00:00
Nicholas Nethercote
07045477ca Merge the DARWIN branch onto the trunk.
I tried using 'svn merge' to do the merge but it did a terrible job and
there were bazillions of conflicts.  So instead I just took the diff between
the branch and trunk  at r10155, applied the diff to the trunk, 'svn add'ed
the added files (no files needed to be 'svn remove'd) and committed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10156
2009-05-28 01:53:07 +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
Nicholas Nethercote
74b7903711 Remove dead code relating to interface versions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9289
2009-02-27 03:38:28 +00:00
Nicholas Nethercote
3ed4532cde In the core, include malloc_usable_size() as one of the functions that must
be replaced if malloc() et al are replaced by a tool.  This is because
different tools implement the function in different ways.

Add an appropriate malloc_usable_size() replacement to each of Memcheck,
Helgrind, DRD, Ptrcheck, Massif.

Update memcheck/tests/malloc_usable and add massif/tests/malloc_usable.

Merged from the DARWIN branch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9193
2009-02-17 04:31:18 +00:00
Nicholas Nethercote
5ad1dd61f9 Introduce a new type, PtrdiffT. Replace lots of uses of OffT (all those
that are memory offsets) with PtrdiffT;  OffT should only be used for file
sizes and offsets.

Change Off64T from a ULong to a Long, as it should be.  Replace some uses
of ULong in the address space manager with Off64T to match.

Also add a comment explaining the meanings of the basic types like Addr,
OffT, SizeT, etc.

Also fix the prototype for VG_(pread) -- the last arg is an OffT, not an
Int.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8959
2009-01-15 21:29:24 +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
a1289fb4ca Bump the core/tool iface version number, since the just-merged-in
changes for Memcheck origin tracking change the interface (slightly).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7984
2008-05-01 21:43:17 +00:00
Julian Seward
4cae5c3ed5 Merge branches/OTRACK_BY_INSTRUMENTATION into the trunk. This adds
support to Memcheck for tracking the origin of uninitialised values,
if you use the --track-origins=yes flag.

This currently causes some Memcheck regression tests to fail, because
they now print an extra line of advisory text in their output.  This
will be fixed.

The core-tool interface is slightly changed.  The version number for
the interface needs to be incremented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7982
2008-05-01 20:24:26 +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
931a40e83b Core-tool iface changes needed to support exp-drd (Bart Van Assche).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7212
2007-11-25 14:06:06 +00:00
Julian Seward
caa1e5d417 Fix bogus grammar in r7139.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7140
2007-11-10 22:19:42 +00:00
Julian Seward
88c1e8eb76 Clarify reason for existence of track_pre_thread_ll_create/_exit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7139
2007-11-10 22:13:03 +00:00
Julian Seward
06666933d9 Merge (from branches/THRCHECK) the following two changes to the core-tool
interface:

r6805: Modify two thread-notification events in the core-tool
interface.  This removes track_post_thread_create and
track_post_thread_join.  The core can only see low level thread
creation and exiting, and has no idea about pthread-level concepts
like "pthread_create" and "pthread_join", so these are a bit
ambiguous.

Replace them with track_pre_thread_ll_create, which is notified before
a new thread makes any memory references, and
track_pre_thread_ll_exit, which is notified just before the new thread
exits, that is, after it has made its last memory reference.

r6823: Core-tool interface: give 'needs_tool_errors' an extra Boolean
indicating whether or not the core should print thread id's on error
messages.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7123
2007-11-09 23:21:44 +00:00
Julian Seward
0ed8fc0ce0 Merge, from CGTUNE branch, a cleaned up version of r6742:
Another optimisation: allow tools to provide a final_tidy function
which they can use to mess with the final post-tree-built IR before it
is handed off to instruction selection.

In memcheck, use this to remove redundant calls to
MC_(helperc_value_check0_fail) et al.  Gives a 6% reduction in code
size for Memcheck on x86 and a smaller (3% ?) speedup.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6787
2007-08-28 06:05:20 +00:00
Julian Seward
4ab7e54154 VG_(needs_shadow_memory) does not exist; remove prototype for it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6761
2007-06-23 16:03:05 +00:00
Nicholas Nethercote
b89c81e048 clarify comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6674
2007-03-27 06:46:03 +00:00
Nicholas Nethercote
1c8e6c7021 s/IRBB/IRSB/
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6570
2007-02-05 23:23:55 +00:00
Julian Seward
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Julian Seward
10c505c003 Get rid of the core-tool events pre_mutex_lock, post_mutex_lock and
post_mutex_unlock.  The core can't detect them anyway any more, so
there's no point in having them.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6456
2006-12-28 20:26:08 +00:00
Nicholas Nethercote
cadc28816d Split the thread_runstate event into two, start_client_code and
stop_client_code, which is a bit clearer and easier to work with.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6418
2006-12-24 07:51:17 +00:00
Julian Seward
1083ded7e2 Non-functional commit: track IR renaming in vex r1689.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6416
2006-12-24 02:24:11 +00:00
Julian Seward
806c8b17b3 Change the core-tool interface 'thread_run' event to be more useful:
- Rename the event to 'thread_runstate'.

- Add arguments: pass also a boolean indicating whether the thread
  is running or stopping, and a 64-bit int showing how many blocks
  overall have run, so tools can make a rough estimate of workload.

  The boolean allows tools to see threads starting and stopping.
  Prior to this, de-schedule events were invisible to tools.

- Call the callback (hand the event to tools) just before client
  code is run, and again immediately after it stops running.  This
  should give correct sequencing w.r.t posting of thread creation/
  destruction events.

In order to make callgrind work without complex changes, I added a
simple impedance-matching function 'clg_thread_runstate_callback' 
which hands thread-run events onwards to CLG_(thread_run).

Use this new 'thread_runstate' with care: it will be called before
and after every translation, which means it will be called ~500k
times in a startup of firefox.  So the callback needs to be fast.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6413
2006-12-23 01:21:12 +00:00
Nicholas Nethercote
52dfe4cb39 Remove defunct constant.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6401
2006-12-15 04:37:25 +00:00
Dirk Mueller
6662c989dc change void* to Addr in mutex helpers. patch by Bard Van Assche.
I've bumped the tool interface version because it seems binary
incompatible.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6350
2006-11-14 14:32:46 +00:00
Julian Seward
68475a1dc5 Fix bug in memcheck's instrumenter introduced in r6319. Big comment
in the code explains it.  Sigh.  Why can't anything be simple?



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6322
2006-10-19 13:22:16 +00:00
Nicholas Nethercote
fad24de4bc Move VG_BUGS_TO to pub_tool_basics.h so that Nulgrind need not import
pub_tool_libcassert.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6320
2006-10-18 21:50:26 +00:00
Julian Seward
77e2257371 Update 'expected' default translation size (partial merge of r6214).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6301
2006-10-17 02:25:50 +00:00
Julian Seward
676afab8a5 Minor comment mods.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6238
2006-10-15 13:47:43 +00:00
Julian Seward
4e2a6f2ccb Add further comments about the tool instrument function.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6237
2006-10-15 13:46:18 +00:00
Julian Seward
86b7021db6 Add proper comments explaining the args for the tool instrumenation
function.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6236
2006-10-15 12:48:18 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +00:00
Nicholas Nethercote
1a7237d77b Remove tool-specific code (which says which tools allow XML) from the core
by introducing a new "need":  VG_(needs_xml_output)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5854
2006-04-16 10:25:43 +00:00
Julian Seward
aa35c50723 Extend stack-permissions-change fast-case machinery to handle +/- 112,
128, 144 and 160.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5640
2006-02-12 15:42:20 +00:00
Julian Seward
f0d678baab These files all speak about instrumentation functions.
Instrumentation functions now take a callback closure structure
(VgCallbackClosure*), so this commit changes the signatures
accordingly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5535
2006-01-17 02:06:39 +00:00