191 Commits

Author SHA1 Message Date
Nicholas Nethercote
a8e6f9f6cf Add some comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4548
2005-08-28 05:21:17 +00:00
Nicholas Nethercote
b0887d95d2 Give informative failure messages if you try to use Helgrind or
Addrcheck.  As a results, we are now building Addrcheck again, which
required commenting out lots of code.

BACKPORT TO 3_0_X, AND POSSIBLY TO 2_4_X (the Helgrind part, with
    modifications)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4384
2005-08-12 15:23:57 +00:00
Nicholas Nethercote
f333641286 Get Addrcheck closer to compiling. It's still a long way from working,
though.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4195
2005-07-19 21:11:54 +00:00
Nicholas Nethercote
d463dd2292 Removed the VGA_/VGO_/VGP_ prefixes for arch/OS/platform-specific
things.  These made sense when the arch/OS/platform-specific code was in
one module, but as that code got mixed in with generic code the boundary
between generic and non-generic blurred, and the distinction made less
sense.  So let's get rid of them.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4002
2005-06-23 03:27:57 +00:00
Donna Robinson
b655e45a8e argh! there were loads of the little beggars ....
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3999
2005-06-23 00:17:51 +00:00
Nicholas Nethercote
35fc371349 Malloc replacement worked very much like a 'need', but wasn't one.
I've changed it so it now is, which makes it consistent with the
other 'needs'.  Because of this, I was also able to invert the dependence
between m_mallocfree and m_tooliface, which is related to setting
the redzone size for client heap blocks.  As a result, m_tooliface
now doesn't depend on anything except pub_core_basics.h, hooray!
 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3979
2005-06-21 03:20:17 +00:00
Nicholas Nethercote
5bdf595e70 Modularised the profiling stuff as m_profile.c. It's much more
sensible now -- no vg_dummy_profile.c, no silly #including of
vg_profile.c from tools.  

Unfortunately, it still doesn't work, due to bad interactions
with signal handling that I don't understand.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3833
2005-06-01 03:09:59 +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
eb32bc7045 Modularised the malloc/free stuff into two modules: m_mallocfree for the
malloc/free implementation, and m_replacemalloc with the stuff for the tools
that replace malloc with their own version.  Previously these two areas of
functionality were mixed up somewhat.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3648
2005-05-10 02:47:21 +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
Nicholas Nethercote
f1f707c7b2 This change reduces the number of calls to dlsym() when loading tools from a
lot to one.  This required two basic changes.

1. Tools are responsible for telling the tool about any functions they
provide that the tool may call.  This includes basic functions like
TL_(instrument)(), functions that assist core services such as
TL_(pp_Error)(), and malloc-replacement-related functions like
TL_(malloc)().  

2. Tools that replace malloc now specify the size of the heap block redzones
through an arg to the VG_(malloc_funcs)() function, rather than with a
variable VG_(vg_malloc_redzone_szB).

One consequence of these changes is that VG_(tool_init_dlsym)() no longer
needs to be generated by gen_toolint.pl.

There are a number of further improvements that could follow on from this one.
- Avoid the confusingly different definitions of the TL_() macro in the
  core vs. for tools.  Indeed, the functions provided by the tools now don't
  need to use the TL_() macro at all, as they can have arbitrary names.
- Remove a lot of the auto-generated stuff in vg_toolint.c and vg_toolint.h
  (indeed, it might be possible to not auto-generate these at all, which
  would be nice).
- The handling of VgToolInterface is currently split across vg_needs.c and
  vg_toolint.c, which isn't nice.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3487
2005-03-31 04:37:24 +00:00
Nicholas Nethercote
f912a81248 Add VGA_ prefix to the arch-specific macros {MIN,MAX}_INSTR_SIZE and
REGPARMS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3458
2005-03-27 01:55:21 +00:00
Nicholas Nethercote
36e86a9542 Add VG_ prefix to SKIPLIST_INIT and IS_*_ALIGNED macros. Also pull
IS_PAGE_ALIGNED into tool.h with the others.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3457
2005-03-27 01:42:41 +00:00
Nicholas Nethercote
27066dbfc5 Don't use the VGP_ for profiling any more, just use VG_ -- we want to use
VGP_ for platform-specific things.  



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3435
2005-03-26 00:42:02 +00:00
Julian Seward
cfdf00d9bd Track Vex API change in rev 1062: pass both the guest and host word
sizes to the instrumentatation functions.  Make most of the tools
abort if they are not the same; we can't handle that case yet.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3397
2005-03-21 00:55:49 +00:00
Julian Seward
f1a3994582 Track Vex API (semantics) changes in rev 1061: introduction of IRStmt_NoOp.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3396
2005-03-21 00:27:41 +00:00
Julian Seward
753b8dcf94 Track minor Vex API changes that occurred in Vex rev 1059.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3393
2005-03-20 18:55:15 +00:00
Julian Seward
dd66bedf94 Add missing break spotted by Nick. Turns out to be harmless - but
only because I was lucky.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3384
2005-03-17 03:17:54 +00:00
Julian Seward
5506291e56 Make existing tools aware of IR instruction marks. (They ignore them,
though).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3381
2005-03-16 18:20:21 +00:00
Nicholas Nethercote
4d3a30c448 Reinstated Memcheck. Did the full merge from CVS, except for the
user-specified block stuff, which confused me because I wasn't sure whether
to use the code already in SVN, or the code in CVS.  Perhaps that code
doesn't need to be changed.

Unfortunately, Memcheck doesn't work entirely correctly -- I get some
spurious errors.  Nonetheless I'm checking it in as a starting point.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3353
2005-03-14 02:42:44 +00:00
Nicholas Nethercote
a551dd690a Reinstate Addrcheck. Some of the tests fail -- some of the leak ones
because the added VG_(find_root_memory)() is just a stub.  And there's a
problem with overlap checking that I haven't worked out yet.  Still it's a
start.  The commit also brings Memcheck back into the build process,
although mc_main.c is entirely commented out at the moment.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3352
2005-03-14 01:16:05 +00:00
Nicholas Nethercote
945e2c13f6 Remove needless insn* tests. (They were removed once before, but were
accidentally re-included as part of the CVS/SVN merge.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3351
2005-03-14 01:06:08 +00:00
Julian Seward
fcbbc8332b Commit half-baked attempts to get memcheck and addrcheck to build.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3350
2005-03-14 00:14:04 +00:00
Nicholas Nethercote
08fd210dd3 Fix minor problems in filters. This helps a couple of massif tests to pass.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3348
2005-03-13 21:40:26 +00:00
Nicholas Nethercote
05fe123a9e Update copyright notice for 2005 on all relevant files. Don't bother trying
to be selective about it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3303
2005-03-12 16:22:54 +00:00
Julian Seward
0356d27ca6 Merge in changes from the 2.4.0 line. This basically brings in the
overhaul of the thread support.  Many things are now probably broken,
but at least with --tool=none, simple and not-so-simple threaded and
non-thread programs work.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3265
2005-03-10 23:59:00 +00:00
Julian Seward
7c542ccd39 Add new files resulting from merging in the 2.4.0 line. Many of these
seem to be simply duplication of the x86 instruction set tests into
the addrcheck and helgrind trees.  I'm not sure what this duplication
achieves.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3264
2005-03-10 23:23:45 +00:00
Julian Seward
022eef96c2 Handle IRStmt_MFence in the tools.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3217
2005-01-07 12:10:21 +00:00
Julian Seward
4a148c84cf Cosmetic-only change (mess with indentation)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3186
2004-12-10 12:01:14 +00:00
Nicholas Nethercote
ce2585d447 Changed message at the top of files, and the startup message, and the
string in valgrind.pc.in, so that they describe Valgrind as a "dynamic
binary instrumentation framework", and don't mention platforms at all.  

I had to tweak the regtest filters a bit for this.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3178
2004-12-01 14:14:42 +00:00
Nicholas Nethercote
b1b5c00b01 Streamlined and consistified alignment checking.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3168
2004-11-30 18:08:05 +00:00
Nicholas Nethercote
7a75a9f583 Overhauled the docs. Removed all the HTML files, put in XML files as
converted by Donna.  Hooked it into the build system so they are only
built when specifically asked for, and when doing "make dist".

They're not perfect;  in particular, there are the following problems:
- The plain-text FAQ should be built from FAQ.xml, but this is not
  currently done.  (The text FAQ has been left in for now.)

- The PS/PDF building doesn't work -- it fails with an incomprehensible
  error message which I haven't yet deciphered.

Nonetheless, I'm putting it in so others can see it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3153
2004-11-30 10:43:45 +00:00
Nicholas Nethercote
57ab6c1b41 Fix post-amd64-commit x86 breakage:
- remove warnings from vg_scheduler.c by using (UWord) casts rather than
  64-bit-assuming (ULong) casts.
- move deref_Addr() to x86-linux/syscalls.c, where it's now used.

Also got rid of the ancient SIGNAL_SIMULATION flag, which is a remnant of very
early days -- things now only work with signal simulation, so no point in
keeping it around.

Also make addrcheck/tests/fprw work again now that --single-step is
dead.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3137
2004-11-29 14:24:57 +00:00
Nicholas Nethercote
ead76e69ac Removing the insn_* tests from helgrind, memcheck, addrcheck and
cachegrind, because having them there doesn't add anything beyond that
tested in 'none'.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3101
2004-11-25 17:47:43 +00:00
Nicholas Nethercote
efed8e4671 Removed shadow_regs 'need', because it was being used only trivially in
a couple of places, and is no longer needed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3096
2004-11-24 16:57:16 +00:00
Nicholas Nethercote
feb4fbaef5 Removed all uses of register numbers (eg. arch-specific ones like R_EAX, and
arch-neutral ones like R_STACK_PTR).  Where they were used, we now always talk
about an offset into the Vex guest state, and an offset.  As a result,
the shadow register get/set functions had to change.  They now also use
an offset and size, and in an arch-neutral way.

Also, I combined the five the post_reg_write* functions into a single one that
takes a 'CorePart' parameter (plus also a ThreadId).  Also, I added more
arguments (the CorePart, and the ThreadId) to the post_mem_write event, for
consistency with the pre_mem_* events.

Also, I reduced the number of register names that must be specified by each
arch, by factoring out duplication; and shortened their names for the core (eg.
ARCH_STACK_PTR is now STACK_PTR).

Plus some related minor cleanups in syscall wrappers.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3094
2004-11-24 16:30:22 +00:00
Julian Seward
3558db91b1 Get rid of baseBlock. Now, when generated code is running, the guest
state pointer points directly at the ThreadState.arch.vex field, thus
updating it in place and avoiding a lot of code (and time-wasting)
which copies stuff back and forth to baseBlock.

Fix zillions of other places in the system where the current thread id
is needed.  It is now passed to all needed places.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3090
2004-11-24 10:44:19 +00:00
Julian Seward
e91eb48b89 Make various other tools compile; also fix the stage2 linker script.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3068
2004-11-22 20:38:40 +00:00
Nicholas Nethercote
400cfc0311 Remove useless parameters to TL_(pre_syscall)() and TL_(post_syscall)().
Also remove Memcheck's and Addrcheck's use of syscall_wrappers,
since they didn't do anything useful.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3064
2004-11-22 19:57:39 +00:00
Nicholas Nethercote
9df62e9f85 Rename macros ("SKIN"-->"TOOL")
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3062
2004-11-22 19:12:49 +00:00
Nicholas Nethercote
454ab569fe Converted the SK_ prefix to TL_ everywhere.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3060
2004-11-22 18:33:15 +00:00
Nicholas Nethercote
3093a1768b Renamed VG_(skin_panic) as VG_(tool_panic).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3057
2004-11-22 18:02:32 +00:00
Nicholas Nethercote
213ef621b7 Renamed functions with 'Skin' in them: SK_(pp_SkinError),
SK_(eq_SkinError), MAC_(pp_shared_SkinError)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3056
2004-11-22 17:57:07 +00:00
Nicholas Nethercote
cf9cf2a220 Renamed sk_assert() as tl_assert().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3055
2004-11-22 17:18:48 +00:00
Nicholas Nethercote
40de233989 Changed name of tool shared objects from vgskin_XXX.so to vgtool_XXX.so.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3054
2004-11-22 16:58:05 +00:00
Nicholas Nethercote
48aff7c26f Convert the 'skin_errors' need to 'tool_errors'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3053
2004-11-22 16:46:13 +00:00
Nicholas Nethercote
3b4dc0bdba Generalised the reg test script again: replaced the "cpu_test" line,
which caused the test to be skipped if the CPU type wasn't appropriate,
with a "prereq" line, which specifies a command that must succeed before
the test is run.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3041
2004-11-18 12:48:17 +00:00
Nicholas Nethercote
b55751404f Improved Memcheck's error checking messages in two significant ways:
- All memory-related errors are now clear whether they are caused by
  unaddressable or uninitialised memory.  (Previously, writes were
  clearly addressability errors, but reads could be either.)  Mostly
  done by replacing the 'isWrite' field in MAC_Error with 'isUnaddr'.
  Also, mc_check_readable() now indicates not just if an error occurred,
  but what kind of error (ie. addressability or definedness).

- Put machinery into place in the core to inform tools when registers
  are being read by the core -- ie. a 'pre_reg_read' event.  Most
  notably, this facilitates syscall scalar arg definedness checking for
  Memcheck.  Currently this is only working for read(), write(), exit()
  and exit_group(), but it will be extended as the syscalls are
  overhauled as part of the arch-abstraction work.

  A consequence of this is that the ParamErr messages have changed.  This:

    Syscall param write(buf) contains uninitialised byte(s)

  now means that the pointer 'buf' is partially undefined.  If the memory
  pointed to by 'buf' is partially undefined or unaddressable, it says one of:

    Syscall param write(buf) points to uninitialised byte(s)
    Syscall param write(buf) points to unaddressable byte(s)

  The docs have been updated accordingly.

  I also added a couple of regression tests.

These two change sare notable for being the first improvements to
Memcheck's checking/errors in a long time.

I also folded mc_clientreqs.c into mc_main.c, which saves exporting a
whole bunch of things that are not used anywhere else.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2949
2004-11-08 19:20:09 +00:00
Nicholas Nethercote
cc936a9c7c 64-bit cleanness: convert client requests to receive and return UWords.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2921
2004-11-04 18:22:28 +00:00
Nicholas Nethercote
d8fc746ba4 64-bit cleanness: Yet more UInt-->SizeT changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2910
2004-11-03 18:10:37 +00:00