121 Commits

Author SHA1 Message Date
Julian Seward
88f01cdebf I forgot to get rid of these when deleting the client stack perms stuff.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1404
2003-01-05 13:11:55 +00:00
Julian Seward
61ee476cc0 Remove the mechanism which allowed clients to set block permissions
on their stacks and have those blocks automatically cleared when the
stack retreats past them.  This never really worked, certainly didn't
work in a multithreaded setting, and slowed everything down due to
having to do even more stuff at %esp changes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1399
2002-12-28 12:55:48 +00:00
Julian Seward
8da1474525 Don't panic on encountering a LeakSupp.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1391
2002-12-26 11:50:21 +00:00
Julian Seward
79a981783a Implement suppressions for leak checks, which is a fairly frequently
asked-for feature.

A leak-check suppression looks like any other, and has the name 'Leak':

{
   example-leak-suppression
   Memcheck,Addrcheck:Leak
   fun:malloc
   fun:foo
   fun:main
}

Fitting this into the core/skin split proved very tricky.  Problem is
we want to scan the suppressions list to find Leak suppressions, but

- The core code can't do it because LeakSupp is a skin-specific
  suppression kind.

- The skin code can't do it because most (all) of the types and
  structures for the suppressions are private to the core.

Eventual "solution" (least-worst thing I could think of) is for the
skins using the leak checker to pass it the value of LeakSupp.
Even that isn't really clean because the skins consider it a value
of type MemCheckSuppKind but the core thinks it must be a
CoreSuppKind, and the two are not to be reconciled.  So I kludged
around this by casting it to a UInt.

Nick, perhaps you know some way to smooth this out?

Apart from that all changes are straightforward.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1390
2002-12-26 01:53:45 +00:00
Julian Seward
0510a0bb1d This test should actually elicit a (false) warning from memcheck,
so the .stderr.exp should reflect that.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1379
2002-12-15 02:59:03 +00:00
Julian Seward
9bd3d362a5 Get rid of the --check-addrVs flag and everything to do with it.
It no longer makes much sense now we have a seperate addrcheck skin.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1371
2002-12-15 01:42:22 +00:00
Julian Seward
e44ce0f395 Merge patch from JeremyF:
67-dist

Fixes to various places Makefile.am to generate proper distributions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1350
2002-12-08 22:19:04 +00:00
Julian Seward
9903164536 Merge patches from JeremyF, to do lazy eflags updating:
- D flag is seperated from the rest (OSZCAP)

- Minimise transfers between real and simulated %eflags since these
  are very expensive.

61-special-d

Make the D flag special. Store it separately in the baseblock rather
than in EFLAGs. This is because it is used almost completely unlike
the other flags, and mashing them together just makes maintaining
eflags hard.

62-lazy-eflags

Implements lazy eflags save and restore. Helps a lot.

Hopefully more documentation to follow.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1346
2002-12-08 18:20:01 +00:00
Julian Seward
ca2f7bac2a Take into account TCEntry and alignment overheads when calculating TC
sector sizes.  Also, recalibrate all skins against mozilla-1.0.1.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1341
2002-12-01 02:55:46 +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
90ef7f01a1 Removed some impossible code (thanks to the way it's called), added an
assertion to ensure it remains impossible.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1329
2002-11-19 16:19:32 +00:00
Nicholas Nethercote
5ab9dd81d6 Fixed broken regression tests:
- For all except `trivialleak', expected output lines like this:

      by 0x........: __libc_start_main@@GLIBC_2.0 (...libc...)

    were changed to look like this:

      by 0x........: (within /.../tests/supp2)

    This change was caused by a change about 3 weeks ago, but we couldn't work
    out exactly which one.  It does not seem unreasonable, though.

  - For `malloc1' and `trivialleak', one of the line numbers changed -- they
    are now correct instead of off by one -- thanks to Jeremy F's recent patch
    which subtracts one from return addresses (for exactly this reason).

Now they all pass again except `tronical', as expected.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1328
2002-11-18 11:46:48 +00:00
Nicholas Nethercote
df503439c5 Overview:
- Factored out a lot of commonality between AddrCheck and MemCheck.  Basic
    idea is that common code goes into a single file in MemCheck, and AddrCheck
    peeks in and "borrows" it.

    More or less, only identical code or identical-with-respect-to-subtypes
    code was factored out.

    Identical-with-respect-to-subtypes means that some enum types (SuppKind,
    ErrorKind, etc) were merged because they were identical except that
    MemCheck had some extra constants.  So some of the code borrowed by
    AddrCheck contains cases it never needs.  But that's not so bad, avoiding
    the duplication is IMHO more important.

Removed:
  - ac_include.h, it wasn't necessary

  - All the old debugging stuff from ac_main.c (printing shadow regs, not
    applicable for AddrCheck).

  - MANUAL_DEPS from memcheck/Makefile.am because it wasn't doing anything

  - Some unnecessary crud from addrcheck/Makefile.am

Added:
  - memcheck/mc_common.{c,h}
  - memcheck/mc_constants.h
  - addrcheck/ac_common.c, which simply #includes memcheck/mc_common.c.  This
    hack was required because there is no way (that I could work out) to tell
    Automake that it should build ../memcheck/mc_common.o before building
    AddrCheck.

Changed:
  - a lot of prefixes from SK_ to MC_;  only core/skin interface functions are
    prefixed with SK_ now.  This makes it clear which functions are from the
    core/skin interface, and for AddrCheck it's clear which functions are
    shared with/borrowed from MemCheck.  Changed some related prefixes for
    consistency.

  - Also factored out some duplication within AddrCheck -- some accessibility
    checking was needlessly split up into separate read and write checks that
    did the same thing.

Unchanged:
  - I considered moving the leak detector out of core into mc_common.c, but
    didn't, because it constantly accesses ShadowChunk fields and converting to
    get/set methods would have been a total pain.

  - Left old debugging stuff in for MemCheck, although I seriously doubt it
    would still work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1325
2002-11-18 11:04:50 +00:00
Julian Seward
0f6cf30022 Restructure the documentation to try and make it hang together better.
Majorly improved.  Still a lot to do, but the structure is better.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1324
2002-11-18 00:07:28 +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
Nicholas Nethercote
488ff9a93a Changed Makefiles so that the following files are installed:
valgrind.h --> $prefix/include/valgrind/valgrind.h
  memcheck.h --> $prefix/include/valgrind/memcheck.h

This mirrors the lib/ structure.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1289
2002-11-12 10:53:31 +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
7240057bc8 Merge patch from Jeremy Fitzhardinge:
14-hg-mmap-magic-virgin
  This does two things:

  1. change the signatures of the new_mem_mmap and change_mem_mprotect
  functions to remove the pointless 'nn' argument. This makes them match
  the signature of new_mem_startup...

  2. change helgrind to mark memory created by mmap as if it were the
  same as other magically pre-inited memory. Implement this by pointing
  helgrind's new_mem_mmap function at new_mem_startup.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1263
2002-10-23 21:46:13 +00:00
Nicholas Nethercote
d8b0b7962d Fixed some argument type wibbles, pointed out by Arnaud Desitter.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1260
2002-10-23 12:54:11 +00:00
Julian Seward
9332fb832a Merge patch from Jeremy Fitzhardinge:
08-skin-clientreq
  Introduce a systematic way for skins to distinguish each other's
  client requests. Uses the de-facto standard two-letter identifiers in
  the top two bytes of the client request code. Also changes the
  interface to SK_(handle_client_request) so that a skin can say whether
  or not it handled the request, which allows correct setting of the
  default return value if the request was not handled.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1251
2002-10-22 04:14:35 +00:00
Julian Seward
976b63337a Common up leak detection stuff which was previously duplicated in Memcheck
and Addrcheck.  In coregrind/vg_memory.c, create

   void VG_(generic_detect_memory_leaks

and remove several hundred lines of code from both ac_main.c and mc_main.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1250
2002-10-21 07:29:59 +00:00
Julian Seward
e6f9adbd38 merge rev 1.35.2.6:
Change the capitalisation of Reuben's Mite.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1237
2002-10-16 19:41:41 +00:00
Nicholas Nethercote
72908a31a6 Wibbles, thanks to Arnaud Desitter.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1232
2002-10-15 08:48:08 +00:00
Julian Seward
9ea62d1526 Incorporate horrible hack to workaround problem of emitting bogus
uninit-value errors on code with inlined strlen() et al from gcc-3.1
and above.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1213
2002-10-13 00:57:26 +00:00
Nicholas Nethercote
1bca542dbb whoops
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1206
2002-10-07 14:46:07 +00:00
Nicholas Nethercote
28823c33b3 Added support for multi-skin suppressions, of the form:
skin_name1,skin_name2:supp_name

No spaces are allowed on either side of the comma.

This is useful for sharing suppressions between Addrcheck and Memcheck.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1205
2002-10-07 14:42:59 +00:00
Julian Seward
fd98e867af Fix strange bug in matching AddrErrs.
Nick, can you sanity-check this?


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1202
2002-10-06 00:19:16 +00:00
Julian Seward
0e4db64cd9 Simplify assembler syntax for R H 6.2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1201
2002-10-06 00:08:57 +00:00
Julian Seward
f75a03682d Make suppressions work again after I messed with skin names. Sigh.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1200
2002-10-05 16:49:09 +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
db419f2bdc Moved discard, clientperm and clientstackperm from tests/ into the test
suite-proper, giving them .vgtest files and all that.  They don't make sense
for 1.0.X because the client request constants are different in HEAD, indeed
one of them (clientperm) fails with --stable.

Also moved blocked_syscall.c from tests/ to tests/unused/.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1181
2002-10-04 14:16:38 +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
dd6989e7b7 comment wibbles
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1175
2002-10-04 09:22:30 +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
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
8bffd600d5 Qualifying suppression types with the skin name, like this:
memcheck:Addr4

Changed the `name' need of the memcheck skin from "valgrind" to "memcheck" for
this.  But the name Valgrind will return when I print core and skin names in
the startup message.

One issue is that some skins share suppression types, eg. memcheck and
addrcheck.  Might be useful to allow multi-skin suppressions, viz:

  memcheck,addrcheck:Addr4

This won't be too hard to tack on, though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1163
2002-10-02 11:02:27 +00:00
Julian Seward
e959615698 Fix build problems on SuSE 8.1 -- -I.. not included in compile cmds
for .S files.  Possibly due to the presence of the following on this dist:

  autoconf (GNU Autoconf) 2.53
  automake (GNU automake) 1.6.3


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1148
2002-10-01 00:18:22 +00:00
Julian Seward
81b048c0c2 Remove comment that nobody can make sense of.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1147
2002-09-30 23:22:54 +00:00
Julian Seward
1938a2fc05 Teach memcheck about instrumenting {GET,PUT,USE}SEG.
Also implement MOV Sw,Ew.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1141
2002-09-30 21:52:50 +00:00
Nicholas Nethercote
f73db69709 wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1140
2002-09-30 13:18:41 +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
284d18dc8f wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1126
2002-09-27 11:45:30 +00:00
Nicholas Nethercote
1a927a7334 wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1120
2002-09-27 10:12:45 +00:00
Julian Seward
d3b9709488 merge rev 1.16.2.3:
Fix bug in 108-byte load/stores.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1114
2002-09-27 01:11:36 +00:00