Commit Graph

520 Commits

Author SHA1 Message Date
Julian Seward
e219d86e6d Fix compile warnings on 32-bit platforms, hopefully without breaking
64-bit platforms.  (a.k.a The Portability Game)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3596
2005-05-02 12:53:38 +00:00
Julian Seward
e014d5790a Define N_PRIMARY_MAP to actually generate a 64-bit constant on 64-bit
platforms, otherwise the address-masking operations to establish
alignment and primary-mappability are wrong on 64-bit platforms.

Also set the size of fast-mapped address space on 64-bit platforms to
16G.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3580
2005-04-28 10:32:02 +00:00
Julian Seward
f9156cb08c Reinstate the leak checker; it works at least on x86.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3577
2005-04-27 22:46:36 +00:00
Julian Seward
a7b8e8ea58 Handle various new 64-bit integer primops.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3576
2005-04-27 11:40:27 +00:00
Julian Seward
a4eecff656 * Modify the instrumenter to use the new primops introduced in
vex rev 1144.

* Observe that mkLazy2 generates IR which often turns into 
  long and slow code sequences in the back end, primarily because
  PCast operations are expensive.  Add a couple of special 
  cases which give noticably better performance when handling
  FP-intensive code on x86.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3572
2005-04-26 23:49:24 +00:00
Tom Hughes
3a9a923718 Support the 64 bit comparison instructions which vex is now using.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3570
2005-04-26 07:44:48 +00:00
Julian Seward
c97ba2bbaa Add 64-bit values to the bogus-literal detector.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3548
2005-04-23 23:26:29 +00:00
Julian Seward
78ed655987 Add 64-bit fast case handlers for loads/stores. On amd64,
MC_(helperc_LOADV8) compiles down to just 12 instructions for the
fast-path, which is pretty darn good.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3547
2005-04-23 23:25:49 +00:00
Julian Seward
2c4c0c38f6 Allow memcheck to take account of VGA_STACK_REDZONE_SIZE -- that is,
account for the fact that on amd64 (really, on amd64-linux) the area
up to 128 bytes below the stack pointer is accessible.  This meant
moving the definitions of VGA_STACK_REDZONE_SIZE to tool-visible
places.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3546
2005-04-23 22:42:27 +00:00
Julian Seward
c0967c9762 Handle 8-byte value-check failures using a special fast-case fn (like
0,1,4 sized) rather than the generic one.  Remove size 2 since that
never seems to get used.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3545
2005-04-23 22:38:38 +00:00
Julian Seward
59505fcb00 Add a few cases arising from testing on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3544
2005-04-23 01:14:51 +00:00
Julian Seward
bb89c6cb32 Tidy up: remove lots of old code, rearrange order of functions
somewhat.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3543
2005-04-22 21:10:28 +00:00
Julian Seward
79354c6b5b mc_LOADVn_slow: When loading from invalid addresses, mark loaded data
as defined.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3542
2005-04-22 20:23:27 +00:00
Julian Seward
7cad1b7f65 Mostly finish fixing fast-path cases. Also enhance sanity checking.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3541
2005-04-22 16:29:19 +00:00
Julian Seward
85e8c334b8 Finish off fast cases for {LOAD,STORE}V{4,2,1} and do an inspection of
it.  Do fast cases for make_aligned_word32_{noaccess,writable}.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3540
2005-04-21 22:16:29 +00:00
Julian Seward
5c01cb38f1 * Crank up the memcheck event-counting system, and enhance it to
name the events, rather than just number them, which makes it a
  lot easier to use

* Based on that, fill in some fast-path cases 
  {LOAD,STORE}V{4,2,1}.  The assembly code looks about the same
  length as it did before, on x86.  Fast-path cases for the
  stack have yet to be done.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3538
2005-04-21 17:34:00 +00:00
Julian Seward
2d1062ccdb Fix a bunch of 64-bit cases required amd64. Stop to ponder whether
there is a better way to handle the 'pessimising cast' family of
operations in such a way that Vex's back-end instruction selectors can
generate better code than they do now, with less verbosity and general
confusingness in the insn selectors.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3536
2005-04-20 22:31:26 +00:00
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