72 Commits

Author SHA1 Message Date
Nicholas Nethercote
8631ca6099 Arch-abstraction:
- Make Lackey talk about "machine instructions" rather than "x86 instructions".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2814
2004-10-20 10:37:00 +00:00
Nicholas Nethercote
13a74aa53a Arch-abstraction: renamed "vg_skin.h" as "tool.h". Kept a residual vg_skin.h
(which just #includes tool.h) for backward-compatibility.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2647
2004-09-02 08:51:43 +00:00
Nicholas Nethercote
acd57ac595 Use Makefile.am includes. This gets rid of 110 lines of repetitive Makefile.am
cruft, yay!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2641
2004-09-01 23:20:49 +00:00
Nicholas Nethercote
0db27515b1 Putting "dist_" in front of a "_DATA" variable means it is included in "make
dist".  This avoids the need to put it in "EXTRA_DIST", and saves a few lines
in all the docs Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2614
2004-08-25 11:40:07 +00:00
Nicholas Nethercote
1bd17a3d0f Remove a bunch of unnecessary -DVG_LIBDIR="\"$(libdir)"\" arguments in
Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2597
2004-08-23 14:02:03 +00:00
Tom Hughes
a2a0946b8a Make VPATH builds work so that valgrind can be built in a different
directory from the source tree. This resolves bug 83040.

Based on patch from Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2450
2004-06-29 09:45:37 +00:00
Jeremy Fitzhardinge
82aaa16ef9 Fix "make distcheck", and also make sure that the generated archive
contains everything needed to "make regtest".  Bump the version.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2308
2004-03-12 10:51:39 +00:00
Nicholas Nethercote
07b8e3438b Updated copyright dates for 2004. Also added a couple of missing headers and
footers to some new files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2177
2004-01-04 16:43:23 +00:00
Jeremy Fitzhardinge
918c3a7b7e This jumbo-checkin is the Full Virtualization checkin. This eliminates
Valgrind's dependency on the dynamic linker for getting started, and
instead takes things into its own hands.

This checkin doesn't add much in the way of new functionality, but it
is the basis for all future work on Valgrind.  It allows us much more
flexibility in implementation, and well as increasing the reliability
of Valgrind by protecting it more from its clients.

This patch requires some changes to tools to update them to the changes
in the tool API, but they are straightforward.  See the posting "Heads
up: Full Virtualization" on valgrind-developers for a more complete
description of this change and its effects on you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2118
2003-12-16 02:05:15 +00:00
Nicholas Nethercote
d6d804d382 Updated all "report bugs to..." messages to point to valgrind.kde.org; also
updated the docs to refer to valgrind.kde.org instead of the old website.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2055
2003-11-20 16:20:55 +00:00
Nicholas Nethercote
fb2d543ee8 Started to rescind the name "skin", replacing it with "tool". Did this in all
the places that normal users will see:

  - command line: --tool=foo (although --skin=foo still works)
  - docs: removed all traces (included renaming coregrind_skins.html to
    coregrind_tools.html)
  - in the usage messages
  - in error messages

Also did in in some places that I judged were unlikely to cause clashes with
existing workspaces:

  - in the header comments of many files (eg. "This file is part of Memcheck, a
    Valgrind tool for...")
  - in the regtests script
  - in the .supp files
  - in AUTHORS
  - in README_MISSING_SYSCALL_OR_IOCTL

Also update the AUTHORS file to mention Jeremy.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2027
2003-11-14 17:47:54 +00:00
Julian Seward
b96d8d6227 Don't panic on MMX UInstrs. In effect, makes it work for MMX, as well
as SSE/SSE2.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1861
2003-09-30 00:13:30 +00:00
Julian Seward
a37fdf4d16 Rename the SSE and MMX uinstrs which read/write integer registers, in
a way consistent with the position of the register field in the
instruction.  In Intel encoding parlance, the G register is in bits
5,4,3 and the E register is bits 2,1,0, and so we adopt this scheme
consistently.  Considering how much confusion this has caused me in
this recent bout of SSE hacking, consistent renaming can only be a
good thing.  It makes it a lot easier to figure out if parts of the
SSE handling machinery are correct, or not.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1698
2003-06-15 21:54:34 +00:00
Nicholas Nethercote
83ef1ca2ed Some Makefile.am changes. Lots of them affected:
- changed deprecated INCLUDES variable to AM_CPPFLAGS

- moved the -DVG_LIBDIR definition from AM_CFLAGS into AM_CPPFLAGS

- generally neatened them up a bit -- removed old commented out stuff, fixed a
  couple of other minor things

Everything works for me, hopefully it won't break things for anyone else...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1680
2003-06-12 14:13:05 +00:00
Nicholas Nethercote
092c9b944b Added "Int exitcode" argument to SK_(fini)(), because it could be useful
for skins.

Changed lackey to print out the exit code.

Changed AUTOMAKE_OPTIONS back to 1.5 (whoops)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1538
2003-04-22 21:41:40 +00:00
Dirk Mueller
02b63b3ba8 reapply automake fixes. make check will now generate the binaries which
are only required for regression testing.

If this breaks something, please mail me first instead of reverting.
Thank you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1530
2003-04-17 17:00:43 +00:00
Nicholas Nethercote
ac7027c441 Updated copyright notices for 2003. Only 4 months late.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1526
2003-04-15 14:58:06 +00:00
Nicholas Nethercote
0756a50bc3 Removed support for the 1.0.X series from the regression test suite -- this
was present from before the core/skin split, which is now dead.  Means the
script is slightly simpler, and we can dispense with lots of expected
foo.stderr.hd files.

Also undid accidental change to required Automake version in main Makefile.am
from my last commit, whoops.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1518
2003-04-08 00:47:05 +00:00
Julian Seward
449e67d079 Implement support for the MMX instruction set. The scheme used is
the same as that for FPU instructions.  That is, regard the MMX state
(which is the same as the FPU state) opaquely, and every time we
need to do a MMX instruction, move the simulated MMX state into the
real CPU, do the instruction, and move it back.  JeremyF's optimisation
to minimise FPU saves/restores applies automatically here.

So, this scheme is simple.  It will cause memcheck to complain bitterly
if uninitialised data is copied through the MMX registers, in the same
way that memcheck complains if you move uninit data through the FPU
registers.  Whether this turns out to be a problem remains to be seen.

Most instructions are done, and doing the rest is easy enough, I just
need people to send test cases so I can do them on demand.

(Core) UCode has been extended with 7 new uinstrs:

   MMX1 MMX2 MMX3
      -- 1/2/3 byte mmx insns, no references to
         integer regs or memory, copy exactly to the output stream.

   MMX_MemRd  MMX_MemWr
      -- 2 byte mmx insns which read/write memory and therefore need
         to have an address register patched in at code generation
         time.  These are the analogues to FPU_R / FPU_W.

   MMX_RegRd  MMX_RegWr
      -- These have no analogues in FPU land.  They hold 2 byte insns
         which move data to/from a normal integer register (%eax etc),
         and so this has to be made explicit so that (1) a suitable
         int reg can be patched in at codegen time, and (2) so that
         memcheck can do suitable magic with the V bits going into/
         out of the MMX regs.

Nulgrind (ok, this is a nop, but still ...) and AddrCheck's
instrumenters have been extended to cover these new UInstrs.  All
others (cachesim, memcheck, lackey, helgrind, did I forget any)
abort when they see any of them.  This may be overkill but at least
it ensures we don't forget to implement it in those skins.
[A bad thing would be that some skin silently passes along
MMX uinstrs because of a default: case, when it should actually
do something with them.]

If this works out well, I propose to backport this to 2_0_BRANCH.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1483
2003-03-26 21:08:13 +00:00
Julian Seward
2d2a15abbf Change a bunch of AM_CFLAGS, AM_CXXFLAGS to CFLAGS, CXXFLAGS.
The AM_ versions totally break compilation on RH6.2.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1447
2003-02-28 23:22:44 +00:00
Dirk Mueller
8f9785b1eb fix make distcheck with newer automake
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1443
2003-02-25 01:48:15 +00:00
Julian Seward
31fb0482e7 Complete integration of the new code management (sectored FIFO) story.
This commit adds stats gathering / printing (use -v -v), and selection
of sector size decided by asking skins, via
VG_(details).avg_translation_sizeB, the average size of their
translations.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1334
2002-11-30 00:49:43 +00:00
Nicholas Nethercote
7cf2e186e3 Lots of changes to future-proof the core/skin interface, making it less likely
that changes will cause binary incompatibilities.  Mostly done by hiding naked
structs with function calls.

Structs hidden in this way were: UCodeBlock, SkinSupp and SkinError (which were
merged back with CoreSupp and CoreError into single types Supp and Error),
ShadowChunk, VgDetails, VgNeeds and VgTrackEvents.  The last three are the most
important ones, as they are (I think) the most likely to change.

Suitable get()/set() methods were defined for each one.  The way UCodeBlocks
are copied for instrumentation by skins is a little different now, using
setup_UCodeBlock.  Had to add a few other functions here n there.  Changed
how SK_(complete_shadow_chunk) works a bit.

Added a file coregrind/vg_needs.c which contains all the get/set functions.
It's pretty simple.

The changes are not totally ideal -- eg. ShadowChunks has get()/set() methods
for its `next' field which arguably shouldn't be exposed (betraying the fact
that it's a linked list), and the get()/set() methods are a bit cumbersome at
times, esp. for `Error' because the fields are accessed quite a few times, and
the treatment of Supps and Errors is a bit inconsistent (but they are used in
different ways), and sizeof_shadow_blocks is still a hack.  But still better
than naked structs.  And one advantage is that a bit of sanity checking can be
performed by the get()/set() methods, as is done for VG_({get,set}_sc_extra)()
to make sure no reading/writing occurs outside the allowed area.

I didn't do it for UInstr, because its fields are accessed directly in lots and
lots of spots, which would have been a great big pain and I was a little
worried about overhead of calling lots of extra functions, although in practice
translation times are small enough that it probably doesn't matter.

Updated the example skin and the docs, too, hurrah.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1314
2002-11-14 12:42:47 +00:00
Julian Seward
18b7ed0c53 Merge patch from JeremyF:
39-lock-prefix

Add a new UInstr LOCK to represent a "lock" prefix in the instruction
stream. This has the same semantics as NOP, but allows a skin to tell
whether a group of UInstrs associated with an x86 instruction are
meant to be locked.

HELGRIND: uses the LOCK UInstr to automatically take and release a
special __BUS_HARDWARE_LOCK__ around locked instructions. This only
works properly if all instructions touching a given address are locked
(even reads).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1310
2002-11-13 22:42:13 +00:00
Julian Seward
5fd0ef7ca3 Just call me Mr Brain-Dead Moron. Move the documentation sources to
where I _should_ have put them in the first place, and fix up the
Makefile.am's accordingly.  'make' and 'make install' now work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1292
2002-11-13 21:24:57 +00:00
Julian Seward
5d93498d4d Add documentation back in, in its new form. Still all very rough and
totally borked, but pretty much all the duplication is gone, and there
is a good start on a common core section in
coregrind/coregrind_core.html.  At least I know where I'm going with
all this now.

The Makefile.am's need to be fixed up.

Basic idea is that, when put together in a single directory, these
files make a coherent manual, starting at manual.html.  Fortunately
:-) "make install" does exactly that -- copies them to a single
directory.

After redundancy removal, there's more that 38000 words of
documentation here, according to wc.  Amazing.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1284
2002-11-11 00:20:07 +00:00
Julian Seward
50040b9ebc Delete all the old documentation ...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1283
2002-11-11 00:11:22 +00:00
Nicholas Nethercote
9c534e3a5f Added a basic core/skin interface versioning system. Each skin must use the
macro VG_DETERMINE_INTERFACE_VERSION exactly once.  If the X.Y core and skin
versions don't have a matching X (indicating binary incompatibility), Valgrind
will abort execution immediately at startup.

I even documented it in the skins guide!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1279
2002-11-08 15:48:16 +00:00
Julian Seward
704a740e17 Naming wibbles -- start skin names with a capital letter (they deserve it)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1198
2002-10-05 15:49:27 +00:00
Nicholas Nethercote
534ab14977 Moved the following macros, which were defined multiple times in multiple
files, into vg_skin.h:

    uInstr0, uInstr1, uInstr2, uInstr3, nameIReg, nameISize, nameSReg,
    newTemp, newShadow, uLiteral, uCCall

As macros they avoid namespace problems (they expand to VG_(whatever)) so
this should work fine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1182
2002-10-04 14:34:15 +00:00
Nicholas Nethercote
d386c3db8e Added one regression test for each of addrcheck, lackey, and helgrind, each of
which had none previously.  They all run tests/true (added as well), just to
automatically catch any total b0rkage errors.

Also fixed up filter_stderr_basic to account for changes to startup message;
my changes from yesterday broke all the --stable tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1179
2002-10-04 11:35:47 +00:00
Nicholas Nethercote
3c7b9b2e03 Changed startup message to give information about skin and core separately.
Added "version" and "copyright_author" fields for skins to supply.

Now startup message looks something like this:

==12698== cachegrind, an I1/D1/L2 cache profiler for x86-linux.
==12698== Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.
==12698== Built with valgrind-HEAD, a program execution monitor.
==12698== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
==12698== Estimated CPU clock rate is 1422 MHz
==12698== For more details, rerun with: -v

The skin can specify a version number, but the skins that will be distributed
with Valgrind don't.

Also changed "x86 GNU/Linux" to the wicked "x86-linux" at Julian's request.

Updated default regression test filter to handle this new startup message.

----

Also moved the skin's name, description, etc., fields out of VG_(needs) into a
new struct VG_(details), since they are logically quite different to the needs.
Did a little code formatting, etc., for this.  Updated skin docs
correspondingly, too.

Also renamed the need `run_libc_freeres' --> `libc_freeres' so it's a noun
phrase rather than a verb phrase.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1172
2002-10-03 14:05:52 +00:00
Nicholas Nethercote
a43fe4a74c Added basic docs for Helgrind, Lackey, CoreCheck.
Minor wibbles in AUTHORS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1170
2002-10-03 10:07:34 +00:00
Nicholas Nethercote
089e7e3bcb Updated file descriptions in the copyright notices to reflect the core/skin
split.  Each skin now has its own two-line description.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1166
2002-10-02 13:26:35 +00:00
Nicholas Nethercote
41a0bcbbbb Changes made so that skin error "report this bug to" messages are distinguished
from core error ones:

  - Split up VG_(panic) into VG_(core_panic) and VG_(skin_panic)

  - Likewise, split vg_assert into vg_assert and sk_assert

  - Added a new need string: `bug_reports_to'

  - Removed VG_(skin_error) which was a previous wussy attempt at this change.
    This removed the need for the hacky redeclaration of VG_(skin_error) in
    vg_profile.c, which is good.

At the moment, Julian and Nick's email addresses are hard-coded into each skin
individually, rather than using a #define in vg_skin.h, because that didn't
feel quite right to me...  jseward@acm.org is still done with a #define for
core errors, though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1164
2002-10-02 11:08:25 +00:00
Nicholas Nethercote
813e2b76f1 Makefile.am wibbles:
- added some missing SUBDIRS variables
  - removed unnecessary coregrind/demangle/ from some INCLUDES lists


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1137
2002-09-30 10:48:07 +00:00
Nicholas Nethercote
4cd67f62e6 Converted all functions visible from vg_skin.h with names in CamelCaps to
use_under_scores instead, to be consistent.

Also added some missing 'extern's on function declarations in vg_skin.h.

Also added a quick note in vg_regtest.in on the simplest way to run regression
tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1135
2002-09-30 10:23:54 +00:00
Nicholas Nethercote
a766333b67 Added .cvsignore file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1092
2002-09-23 11:36:39 +00:00
Nicholas Nethercote
f1689b96db Changed lots of files for the new core/ + skin/ directory structure:
- changed lots of Makefile.am files
   - changed configure.in
   - changed lots of #include lines for changed file names
   - changed lots of file headers n footers for changed file names
   - changed vg_regtest to handle new directory structure -- recursively
     traverses subdirectories for .vgtest test files
   - changed lots of paths in memcheck/ regression test expected outputs


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1090
2002-09-23 11:21:57 +00:00
Nicholas Nethercote
afebe61b37 Files updated, added and removed in order to turn the ERASER branch into HEAD
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1086
2002-09-23 09:36:25 +00:00
Julian Seward
7b7227adc8 Include valgrind.spec and valgrind.spec.in in tarballs.
Also add a line to the description in the .spec.in.
(Shlomi Fish)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@494
2002-07-13 12:37:28 +00:00
Julian Seward
2709e5a7f9 Add helpful info for package builders.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@482
2002-07-01 08:46:27 +00:00
Nicholas Nethercote
b859182c44 Removed the need for the user to generate a cache simulation -- now do
automatic cache configuration detection using the CPUID instruction.
This can be overridden from the command-line if necessary.

vg_include.h:
    - added the cache_t type and UNDEFINED_CACHE macro

    - added command line args (of type cache_t) allowing manual override of
      I1/D1/L2 configuration

    - added log2(), which is generally useful

vg_main.c, valgrind.in, cachegrind.in:
    - added handling of the new --{I1,D1,L2}=<size>,<assoc>,<line_size>
      options

vg_cachesim.c:
    - lots of stuff for auto-detecting cache configuration with CPUID.
      Only handles Intel and AMD chips at the moment, and possibly not all of
      them.  Falls back onto defaults if anything goes wrong, and the configs
      can be manually overridden from the command line anyway.

    - now not printing cache summary stats if verbosity == 0.  Still writing
      cachegrind.out, though.

vg_cachesim_gen.c:
    - new file containing stuff shared by the I1/D1/L2 simulations

vg_cachesim_{I1,D1,L2}:
    - removed most of it;  each now just calls a macro defined in
      vg_cachesim_gen.c

vg_cachegen:
    - has been cvs removed as it is no longer needed.

Makefile.am:
    - added vg_cachesim_gen.c

    - removed vg_cachegen

configure.in:
    - removed vg_cachegen


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@400
2002-06-08 13:36:03 +00:00
Julian Seward
a487ef1ce7 A new kind of error: PThread errors. Used to report detected misuse in
the pthread_* API.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@379
2002-06-04 22:54:20 +00:00
Julian Seward
96b04d4f30 Fix fork/exec stuff so it works again. We have to mangle LD_LIBRARY_PATH
as well as LD_PRELOAD, so as to make our libpthread.so go out of scope
when a child which we don't want to trace, is exec'd.  Otherwise the
child can wind up being connected to our libpthread.so but not to
valgrind.so, which is an unworkable combination; you have to be connected
to both or neither.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@291
2002-05-18 13:14:17 +00:00
Frédéric Gobry
460d2313d2 Use $(srcdir) to specify the location of the linker script
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@268
2002-05-13 07:50:45 +00:00
Julian Seward
59ff40a36c Insert hacks, only partially successful, to make 'make distcheck' work
with the new vg_libpthread.vs linker script.  Problem is that builds
where builddir != srcdir don't work now.  Don't know how to fix.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@253
2002-05-10 03:03:57 +00:00
Julian Seward
aa02efa1a0 More symbol versioning stuff
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@250
2002-05-10 01:52:58 +00:00
Julian Seward
ee775d8b61 Add a version script so as to create the right versioned symbols for
libpthread.so.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@249
2002-05-10 01:42:33 +00:00
Julian Seward
ebe11593f2 Build and install 'cachegrind' along with 'valgrind'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@181
2002-05-01 01:25:45 +00:00