Commit Graph

503 Commits

Author SHA1 Message Date
Julian Seward
fbc1c4c2ff Initial rehash of Memcheck's shadow-space management to support both
32- and 64-bit targets, little- and big-endian.  It does more or less
work on x86 as-is, although is unusably slow since I have knocked out
all the fast-path cases and am concentrating on getting the baseline
functionality correct.  The fast cases will go back in in due course.

The fundamental idea is to retain the old 2-level indexing for speed,
even on a 64-bit target.  Since that's clearly unviable on a 64-bit
target, the primary map handles only first N gigabytes of address
space (probably to be set to 16, 32 or 64G).  Addresses above that are
handled slowly using an auxiliary primary map which explicitly lists
(base, &-of-secondary-map) pairs.  The goal is to have the
address-space-manager try and put everything below the 16/32/64G
boundary, so we hit the fast cases almost all the time.

Performance of the 32-bit case should be unaffected since the fast map
will always cover at least the lowest 4G of address space.

There are many word-size and endianness cleanups.

Jeremy's distinguished-map space-compression scheme is retained, in
modified form, as it is simple and seems effective at reducing
Memcheck's space use.

Note this is all subject to rapid change.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3535
2005-04-20 14:44:11 +00:00
Julian Seward
94ee81b0b9 Add a missing case. I guess it can't have been wildly popular :-)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3496
2005-04-01 20:20:12 +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
416be3f29e Remove the "vg_" prefix from a lot of non-global variables.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3462
2005-03-27 03:40:28 +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
8aac9bd8a7 Make the 'arg' parameter to VG_BOOL_CLO and similar macros explicit, rather
than implicit.  Also tweak some formatting of command-line arg code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3453
2005-03-27 01:00:11 +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
Nicholas Nethercote
f474d2e51a A modularisation + refactoring commit. vg_execontext.c has been split into
two halves: stacktrace.c, which deals with getting, traversing and printing
stack traces;  and execontext.c, which deals with storing stack traces
permanently in a way that avoids duplicates, and comparing them.

One nice outcome:  previously we were often creating ExeContexts, which live
forever, even when they were only needed temporarily.  Ie. this was a memory
leak, which has been removed.

As part of this, new headers have been created, carved off core.h and
tool.h.  Lots of function names have changed, too.

In Massif, I also changed a lot of "eip" names to "ip" to make them less
x86-specific.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3429
2005-03-25 23:35:48 +00:00
Nicholas Nethercote
1826c24b7f Bah, get the compiler-warning avoidance right this time.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3422
2005-03-24 04:41:16 +00:00
Nicholas Nethercote
3f724359ac Avoid compile warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3420
2005-03-24 04:39:33 +00:00
Nicholas Nethercote
7a5c53d749 Use a macro to add declarations for functions like memcpy(), so that GCC
doesn't warn about missing declarations.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3417
2005-03-24 04:00:03 +00:00
Julian Seward
2e5e444f34 amd64-linux build fix
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3412
2005-03-23 13:09:55 +00:00
Nicholas Nethercote
6a687109c0 De-convolute somewhat the client request usage for reporting overlap errors.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3407
2005-03-22 04:27:14 +00:00
Nicholas Nethercote
e65bcc8d43 make function names more uniform
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3406
2005-03-22 04:02:43 +00:00
Julian Seward
cdb6df5b59 Track recent jmp_with_stack hackery.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3405
2005-03-22 02:43:14 +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
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
Julian Seward
2eb10d8e1c Add another possible .stderr output for memcheck/tests/writev.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3379
2005-03-16 13:10:44 +00:00
Julian Seward
bdca1d1f3d Remove pth_once from memcheck/tests. It already exists in
corecheck/tests and there is no point in duplicating it.  Given that
it was intended to check the behaviour of our now-defunct pthread
implementation there's not much point in keeping it at all.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3378
2005-03-16 12:37:30 +00:00
Julian Seward
d56fb1f475 Update expected outputs to include missing stack frames that old UCode
machinery caused to be missed due to not keeping %EBP up to date.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3375
2005-03-16 11:55:34 +00:00
Nicholas Nethercote
3b6dc1d548 Make scalar.c slightly more robust against certain kinds of failures.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3372
2005-03-16 03:29:08 +00:00
Nicholas Nethercote
05cbc6b2e1 Tweak manuel2 so that the Memcheck-detected error is more reliable, and that
we never accidentally also get an undefined-condition-error.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3371
2005-03-16 03:07:33 +00:00
Nicholas Nethercote
3c1778a582 Don't let GCC4.0 inline memcpy() and memcmp(), else the tests fail.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3370
2005-03-16 02:49:11 +00:00
Julian Seward
41f38689dd Looks like the monkeys-with-typewriters department wrote the size-8
for-Vex load/store cases.  Try and improve things.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3369
2005-03-16 00:41:34 +00:00
Julian Seward
5c825716bd Merge in the revised client request stuff from 2.4.X. This significantly
reduces the number of memcheck regtest failures we get.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3367
2005-03-15 23:30:32 +00:00
Julian Seward
4f5ccbe0c2 gcc-2.96 build fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3362
2005-03-15 01:41:08 +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
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
58fb32879e Make MAC_(print_malloc_stats) local by moving it and associated stuff to
mac_needs.c.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3336
2005-03-13 06:10:20 +00:00
Nicholas Nethercote
6c7e08a8f5 Documentation update. This should bring the core of the documentation
up to date with reality.  Please give this a proofread.

I ran out of steam at memcheck/docs/mc_techdocs.html, which is even more
hopelessly out of date.  I will note that cacheprof.org is some kind of
dental insurance company now...

MERGED, PAINFULLY, FROM CVS HEAD



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3321
2005-03-12 22:14:42 +00:00
Nicholas Nethercote
5ef4243598 Default to using --leak-check=summary.
MERGED FROM CVS HEAD



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3312
2005-03-12 20:38:13 +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
Nicholas Nethercote
1b3b96a692 Fix false assertion in pattern matching.
MERGED FROM CVS HEAD


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3279
2005-03-11 05:05:50 +00:00
Nicholas Nethercote
38c5424bc9 Remove messages about not being able to clean up non-existent core files.
MERGED FROM CVS HEAD


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3277
2005-03-11 04:48:18 +00:00
Julian Seward
d5b545da24 These files are no longer needed. Bye!
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3266
2005-03-11 00:22:10 +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
8d9a222274 Track renaming of Vex's Iop_*128* primops to Iop_*V128*.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3232
2005-02-07 23:50:18 +00:00
Julian Seward
990997c313 Handle Add64/Sub64 (naively).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3224
2005-01-15 20:43:58 +00:00
Julian Seward
9091a78381 Add support for 64-bit SIMD primops.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3223
2005-01-13 19:17:06 +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
d703ca2b44 Finishing installing PaulM's improved accuracy handling for Add/Sub,
and also do better for CmpEQ/CmpNE.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3212
2004-12-31 01:16:11 +00:00
Julian Seward
97c1a3baee mkUifU: add missing case
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3205
2004-12-17 01:24:54 +00:00
Julian Seward
b7a642c80b Handle Iop_Sar16.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3197
2004-12-14 01:15:31 +00:00
Julian Seward
3ad2ff4302 Complete enough 128-bit vector stuff in memcheck so that SSE2 works.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3192
2004-12-12 16:45:06 +00:00
Julian Seward
bc929b0e2d Support for 64x2 vector floating point.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3191
2004-12-10 21:44:22 +00:00