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
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
- 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
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
- 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
- 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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