50 Commits

Author SHA1 Message Date
Nicholas Nethercote
d162731a2c Completely overhauled the internals of Memcheck's error handling. All the
different error kinds were reusing the same struct for storing their
details.  Each one used some but not all the fields, and the AddrInfo was
similar, and it was very confusing.

So I changed MC_Error and AddrInfo to be tagged unions, like Vex's IRExpr and
IRStmt types.  The resulting code is a little more verbose but much easier
to understand.  I also split up several error kinds, which also made things
simpler.  The user-visible behaviour is identical except for a couple of
very minor things that I've documented in the NEWS file for the 3.3.0
release.

Ideally I'd get rid of the Addr and Char* fields in the core Error type,
which are not always used, and do them similarly within tools.  But that
would require changing the core/tool interface, so I'm leaving it for the
moment.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6402
2006-12-16 00:54:12 +00:00
Nicholas Nethercote
033e3bd4e9 Removed the unused pthread_model and thread_model modules.
Mostly commented out the unused stuff relating to ThreadErrs and MutexErrs,
which no longer exist.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6399
2006-12-14 02:55:58 +00:00
Julian Seward
771e4abcc9 When generating suppressions, remember to Z-demangle function names,
since the suppression-matching machinery does the same.  Not doing so
causes auto-generated suppressions involving Z-mangled fn names to not
work.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6377
2006-12-06 03:35:38 +00:00
Julian Seward
2da78eb433 Merge r6134:
Accumulate statistics about the number of searches in the errors and
suppressions lists, and rearrange the suppressions list when searching
to reduce cost of future searches.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6271
2006-10-17 01:41:17 +00:00
Julian Seward
ae8215b3ac Create a new module, m_vki, and move all knowledge about the kernel
interface, except for the syscall numbers, into that.  Mostly this
means moving include/vki-*.h to include/vki/vki-*.h.

include/pub_tool_basics.h previously dragged in the entire kernel
interface.  I've done away with that, so that modules which need to
see the kernel interface now have to include pub_{core,tool}_vki.h
explicitly.  This is why there are many modified .c files -- they have
all acquired an extra #include line.

This certainly breaks all platforms except x86.  Will fix shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6225
2006-10-14 19:26:10 +00:00
Julian Seward
e8dd52219f Make 'c'/'C' work again with --gen-suppressions=yes. I wonder how
long this has been broken.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5978
2006-06-25 12:18:20 +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
Julian Seward
0eb39e5af3 Increase number of unsuppressed errors shown before cutoff by a factor
of 100.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5895
2006-05-12 23:12:30 +00:00
Julian Seward
92ac47d62f Add handy debugging line.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5552
2006-01-19 03:36:52 +00:00
Julian Seward
a9bbc3690b Fix an all-platforms bug introduced by the recent overhaul of function
interception and wrapping.  This was causing failures matching
function names in suppressions to function names in backtraces when
the latter names were Z-encoded (eg malloc), which typically caused
all leak suppressions to fail because they contain names such as
malloc, which are Z-encoded.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5548
2006-01-18 04:23:10 +00:00
Julian Seward
f9a9e03c7a Merge in function wrapping support from the FNWRAP branch. That
branch hereby becomes inactive.  This currently breaks everything
except x86; fixes for amd64/ppc32 to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5520
2006-01-12 12:32:32 +00:00
Nicholas Nethercote
c8b46396d2 Fix a minor --gen-suppressions output bug.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5382
2005-12-19 19:40:12 +00:00
Julian Seward
4e27498796 In XML mode, emit a closing </valgrindoutput> on various kinds of
failures, so as to help parsers stop parsing:

- after any kind of assertion failure or panic
- if suppression file is missing or has a syntax error



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5130
2005-11-14 17:01:01 +00:00
Julian Seward
7ee131a3e3 Increase the threshold above which new errors are not shown from 300
unique / 30000 total to 1000 unique / 100000 total.  Programs are
generally bigger now than 3 years ago.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4957
2005-10-20 01:57:29 +00:00
Nicholas Nethercote
224dad480c Make it possible to match against "???" line in suppressions,
using "obj:*" or "fun:*".  Also generate "obj:*" for such lines
with --gen-suppressions.  Includes a regtest.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4447
2005-08-18 15:49:21 +00:00
Cerion Armour-Brown
429d94fc43 fixed endianness bug for ppc xml output
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4358
2005-08-09 22:34:18 +00:00
Julian Seward
5e41090846 Print all XML output with a consistent nesting style, so as to make it
easier to compare it to the output of other XML generating tools.
Regtest expected-output changes to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4356
2005-08-09 22:03:08 +00:00
Julian Seward
ed702a8db4 When printing error counts, print the <unique> in the same way that
it is in the error itself.  Otherwise it's totally useless :-)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4355
2005-08-09 21:50:18 +00:00
Julian Seward
6789f6542e A commit which is almost all trivial change.
- m_main: if --log-file-qualifier applies, do not add ".pid"
  at the end of the name

- Fix the logic which detected whether the just-devised name
  already existed.  This was broken (by me) because it could not
  distinguish the reasons for failing to open the logfile.

  Doing this required changing the return type of VG_(open)
  from Int to SysRes (to make failure reasons visible) and 
  that's the cause of most of the changes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4228
2005-07-23 09:18:34 +00:00
Julian Seward
ae8310aa86 Use %t rather than %s in some places for constructing XML output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4188
2005-07-19 15:00:25 +00:00
Nicholas Nethercote
d5349f32e6 Remove dead code.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4145
2005-07-10 16:57:24 +00:00
Julian Seward
e0387c7153 Make the unique tags printed on XML errors actually unique.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4091
2005-07-02 21:16:30 +00:00
Nicholas Nethercote
4e8bcf9076 Move the last remaining tests out of corecheck.
Also introduced VG_(showing_core_errors)() to make core error display
more consistent.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4073
2005-07-01 04:15:36 +00:00
Julian Seward
2a0a78dffe A couple more XML cases that slipped through the net.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4056
2005-06-30 00:10:16 +00:00
Julian Seward
bef467758b XML output wibble (purely decorative)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4055
2005-06-29 23:38:33 +00:00
Nicholas Nethercote
78acf96da0 Don't #include pub_core_stacktrace.h in pub_core_execontext.h. So
a few places have to #include pub_core_stacktrace.h themselves, but
that's ok because explicit is better.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3976
2005-06-21 00:33:19 +00:00
Nicholas Nethercote
f4d8932fc8 Remove some unnecessary #includes, comment some others.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3966
2005-06-20 03:36:51 +00:00
Nicholas Nethercote
1b3a92639e Moved VG_(start_debugger) out of m_main.c into its own module,
m_debugger.  This removes the dependence of m_signals.c and m_errormgr.c
on m_main.c.  It required also moving VG_(clexecfd) out of m_main.c;  I put
it in m_libcproc.c which seemed like an ok-but-not-great choice.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3957
2005-06-19 19:25:44 +00:00
Nicholas Nethercote
62fa883300 Move VG_(bbs_done) out of main and make it local in scheduler.c. This
removes the dependence of m_translate.c and m_libcassert.c on m_main.c.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3954
2005-06-19 18:38:24 +00:00
Nicholas Nethercote
f174930b23 Final commit for the initial modularisation pass:
- Broke part of m_scheduler off into a new module m_threadstate.  It
  contains ThreadState, VG_(threads)[] and some basic operations on the
  thread table.  All simple stuff, the complex stuff stays in m_scheduler.
  This avoids lots of circular dependencies between m_scheduler and other
  modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
  include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944
2005-06-19 01:24:32 +00:00
Nicholas Nethercote
e3abdc62d5 Finished the modularisation of vg_mylibc.c, which meant it could be removed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3894
2005-06-12 02:43:17 +00:00
Nicholas Nethercote
bd0bea1552 Remove VG_ERRTXT_LEN from core.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3886
2005-06-11 05:04:09 +00:00
Nicholas Nethercote
38d2799b5b Having moved VG_(arena_strdup)() out of core.h, core.h no longer
needs to #include pub_core_mallocfree.h.  As a result, we need
to #include it explicitly everywhere else.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3881
2005-06-11 01:31:52 +00:00
Nicholas Nethercote
face101a47 Modularised file and socket libc stuff in m_libcfile.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3844
2005-06-04 20:03:55 +00:00
Nicholas Nethercote
eb2d0a7d06 Modularised assertions and panics in m_libcassert.
As part of this, killed the VG_STRINGIFY macro, which was used to expand
out names like "VG_(foo)" and "vgPlain_foo" in assertion failure
messages.  This is good since we actually want the "VG_(foo)" form used
in these messages.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3842
2005-06-04 19:16:06 +00:00
Nicholas Nethercote
dbc8c6d99c Modularise printing functions in m_libcprint.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3840
2005-06-03 03:08:39 +00:00
Nicholas Nethercote
09980587a9 Started modularising vg_mylibc. Put all the standalone stuff -- ie. not
relying on any other modules -- in m_libcbase.

Also converted the 'size' parameters to functions like VG_(memcpy) and
VG_(strncpy) from Int to SizeT, as they should be.

Also removed VG_(atoll16) and VG_(toupper), which weren't being used.

Also made VG_(atoll36) less flexible -- it now only does base-36 numbers
instead of any base in the range 2..36, since base-36 is the only one we
need.  As part of that, I fixed a horrible bug in it which caused it to
return incorrect answers for any number containing the digits 'A'..'I'!
(Eg. for "A; it would return 17 instead of 10!)

Had to disable the assertions in VG_(string_match), since this module can't
see vg_assert, which wasn't ideal but also isn't a disaster.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3838
2005-06-02 03:39:33 +00:00
Julian Seward
ff9e61ce9a Minor refinements/bug-fixes to XML printing.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3837
2005-06-01 17:35:23 +00:00
Nicholas Nethercote
d01259a1d0 Modularised all the debug info stuff as m_debuginfo/. It's a mess
and needs further cleaning up, but it's a start.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3821
2005-05-31 02:38:09 +00:00
Nicholas Nethercote
d13bacd9cd Modularised vg_main.c as m_main.c. Moved some stuff out of it to reduce the
number of files that depend on it, but there are still some which should be
removed in the future.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3819
2005-05-31 00:23:43 +00:00
Julian Seward
01017a2f82 XML output futzing-around-with.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3794
2005-05-24 14:21:45 +00:00
Julian Seward
651db21589 Print error counts in the XML output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3779
2005-05-20 02:29:52 +00:00
Julian Seward
161cfde150 First pass at adding ability for Memcheck to print all output in XML
form.  The relevant flag is --xml=yes.  Currently this only works with
Memcheck.

Specifying this flag fixes various other options relating to verbosity
and behaviour of the leak checker, so that the resulting output is in
a relatively fixed form suitable for parsing by GUIs.

Still to do:

* Add mechanism to show error counts
* Add regression test
* Document the resulting format



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3773
2005-05-19 00:25:45 +00:00
Nicholas Nethercote
937a49ea05 Added module m_options for holding all the command-line option stuff.
Perhaps parts of process_cmd_line_option() should go in here, but I've
not done that for now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3751
2005-05-16 23:31:24 +00:00
Nicholas Nethercote
d36924d966 bugfix: don't print bogus "obj:" lines when generating suppressions.
Thanks to Julian for spotting and diagnosing it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3728
2005-05-15 21:09:40 +00:00
Nicholas Nethercote
92c61a5fd1 Don't mix backticks and apostrophes when quoting words -- eg. use 'foo'
rather than `foo', as www.cl.cam.ac.uk/~mgk25/ucs/quotes.html explains
we should (in more detail than you'd imagine was possible).  I did this
both in output messages and in some comments, for consistency.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3723
2005-05-15 17:28:26 +00:00
Nicholas Nethercote
a08637efe9 Modularised vg_translate.c as m_translate.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3700
2005-05-13 23:11:40 +00:00
Nicholas Nethercote
247e241160 Modularised the core/tool interface ('details', 'needs' and VG_(tdict))
into a new module m_tooliface.  Pretty straightforward.  Touches a lot
of files because many files use this interface and so need to include
the headers for the new module.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3652
2005-05-10 04:37:01 +00:00
Nicholas Nethercote
a08662c48c Big clean-up: changed the core/tool interface to be mediated entirely
through the VG_(tdict) function dictionary, rather than using TL_(foo)
functions.

This facilitated the following changes:

- Removed the "TL_" prefix, which is no longer needed.

- Removed the auto-generated files vg_toolint.[ch], which were no longer
  needed, which simplifies the build a great deal.  Their (greatly
  streamlined) contents went into core.h and vg_needs.h (and will soon
  go into a new module defining the core/tool interface).  
  
  This also meant that tool.h.base reverted to tool.h (so no more
  accidentally editing tool.h and not having the changes go into the
  repo, hooray!)  And gen_toolint.pl was removed.  And toolfuncs.def was
  removed.

- Removed VG_(missing_tool_func)(), no longer used.

- Bumped the core/tool interface major version number to 8.  And I
  killed the minor version number, which was never used.  The layout
  of the ToolInfo struct is such that this should not cause problems.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3644
2005-05-09 01:02:08 +00:00
Julian Seward
4ea28e5187 Rename the first three modules as per naming scheme.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3555
2005-04-24 12:33:12 +00:00