Commit Graph

2674 Commits

Author SHA1 Message Date
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
Nicholas Nethercote
e3b0b762de Add note.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3539
2005-04-21 22:11:46 +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
Nicholas Nethercote
d826bf12a0 Comment-only change
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3537
2005-04-21 02:37:54 +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
82378116c1 Add another redirect that we need. This has no effect at present
because the redirect syms are set up only after the initial read of
/proc/self/maps and by then ld-linux.so.2 is already aboard.  Fixing
this properly requires fixing the address space management stuff
properly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3534
2005-04-20 14:32:32 +00:00
Julian Seward
fb5888c4ba Disable Addrcheck builds whilst I'm doing bull-in-a-china-shop stuff
with Memcheck.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3533
2005-04-20 14:30:19 +00:00
Nicholas Nethercote
5446180661 Renamed vg_errcontext.c as errormgr.c, and carved off the relevant parts of
core.h and tool.h into pub_core_errormgr.h and pub_tool_errormgr.h.  All
just to improve general modularity.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3532
2005-04-19 04:10:25 +00:00
Nicholas Nethercote
d1017a6cd9 Fix two typos.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3531
2005-04-16 14:58:34 +00:00
Julian Seward
3b5e9f64f7 Some notes from memcheck size/endian hackery
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3530
2005-04-09 18:25:06 +00:00
Julian Seward
d0ac5b356f Record useful info from Jeremy.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3529
2005-04-09 18:24:19 +00:00
Nicholas Nethercote
9aecfe0d13 Added new assert macros vg_assert2 and tl_assert2 which allow you to print a
string explaining more detail if the assertion fails (eg. the value of the
bogus variable) using printf-style format arguments.

One consequence of this is that you can do something like
 
  vg_assert2(0, "bad bad bad");

instead of calling VG_(core_panic).  The advantage of the new approach is
that it shows the file/function/line info for the failing code, whereas
VG_(core_panic)() does not.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3528
2005-04-08 23:28:23 +00:00
Julian Seward
b6cf98b540 Update expected output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3527
2005-04-07 17:39:08 +00:00
Julian Seward
7755428fed Add exhaustive tests for pslldq/psrldq.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3526
2005-04-07 17:32:20 +00:00
Julian Seward
96f7c469bb Reword error messages in a not-quite-so-terse way.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3525
2005-04-07 02:24:23 +00:00
Julian Seward
6022de545d Even more syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3524
2005-04-07 02:23:50 +00:00
Nicholas Nethercote
97300c75b9 Remove --sloppy-malloc from man page.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3523
2005-04-05 21:06:56 +00:00
Julian Seward
394ef03a88 Get rid of the --sloppy-malloc= flag and the functionality it
controlled (rounding user malloc requests up to a multiple of 4).
Subsequent changes to memcheck made it more or less pointless, it is a
time waster in the malloc/free path, and nobody ever used it AFAIK.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3522
2005-04-05 20:59:55 +00:00
Tom Hughes
67b984d856 Removed bogus (UInt) casts from the amd64 signal frame builder and some
unecessary casts and code from the x86 signal frame builders.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3521
2005-04-05 18:36:05 +00:00
Nicholas Nethercote
fe21329e16 Renamed and retyped the fields relating to valgrind's stack in os_state_t to
make their role clearer and their behaviour more consistent with the fields
describing the client's stack.  Also made the code in x86-linux/syscalls.c
and amd64-linux/syscalls.c more word-size-independent, which is not strictly
necessary but makes the code similarities between the two files more
obvious.

One consequence of this is that Valgrind's stack on AMD64 is now 16384 * 8
bytes, rather than 16384 * 4 bytes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3520
2005-04-05 02:49:09 +00:00
Tom Hughes
eaea598d41 Removed references to client_stack_base which no longer exists.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3519
2005-04-04 07:15:04 +00:00
Nicholas Nethercote
fa9e1310ce Remove the x86-specific is_valid_data_size() test. Also, make any dataSize
greater than MIN_LINE_SIZE equal to MIN_LINE_SIZE.  This makes the
x86/fpu-28-108 regression test pass.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3518
2005-04-04 02:52:16 +00:00
Nicholas Nethercote
2f21dcf1fa 64-bit cleanness -- use UWord instead of UInt.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3517
2005-04-04 02:48:32 +00:00
Nicholas Nethercote
c8f3476758 minor cleanup with the stack-related fields in ThreadState:
- removed "stack_base" which wasn't used in any meaningful way
- added "client_" prefix to make it clear they concern the client's stack
- renamed "stack_size" as "client_stack_szB" to make the units clear



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3516
2005-04-04 02:41:42 +00:00
Julian Seward
6645b8bee9 Deal with apparently non-cfront compliant new[]/delete[] manglings
generated by the Portland Group's C++ compiler.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3515
2005-04-03 20:04:52 +00:00
Nicholas Nethercote
0e1afb5abc gen_intercepts.pl doesn't exist any more.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3514
2005-04-03 03:11:27 +00:00
Julian Seward
26abbc7615 Update expected outputs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3513
2005-04-03 00:16:11 +00:00
Julian Seward
0e735dde57 In vg_memory.c, allow the stack-change threshold to be specified by a
command-line flag (--max-stackframe=number), rather than hardwiring it
to 2000000.  This is helpful for dealing with unruly Fortran programs
which want to allocate large arrays on the stack.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3512
2005-04-02 23:40:59 +00:00
Tom Hughes
577fc708f5 More amd64 system calls - emacs will now run under valgrind.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3511
2005-04-02 17:43:50 +00:00
Julian Seward
1a2c48a114 A major overhaul of how malloc/free intercepts are done. The general
idea is the same -- write functions with special names encoding
sonames and fn names, and have the redir mechanism notice them.
However the way the functions are generated is significantly changed:

* The name mangling scheme has been replaced with one which is just about
  simple enough not to need a preprocessing phase.  Hence
  vg_replace_malloc.c.base is replaced by vg_replace_malloc.c, and
  the preprocessor disappears.  The demangler in vg_symtab2.c changes
  accordingly.

* Kill off the horrendous LIBALIAS macro.  In return we have to
  enumerate all the redirections longhand, but this is not a big deal.

* Remove use of the GNUisms "attribute alias" and "attribute
  protected".

* Remove the hardwired assumption that any C++ new/new[]/etc symbols
  we might want to intercept are mangled in GNU style.

* Add more comments.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3510
2005-04-02 17:38:59 +00:00
Tom Hughes
738816fc3c Get cache detection going again on x86.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3509
2005-04-02 17:30:19 +00:00
Tom Hughes
6f730dd6da Make cache detection work on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3508
2005-04-02 17:26:07 +00:00
Tom Hughes
7f5a0ed772 Remove vg_instrument.c from the makefile.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3507
2005-04-02 17:25:34 +00:00
Julian Seward
54279266b4 Get rid of apparently-redundant file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3506
2005-04-02 17:16:25 +00:00
Tom Hughes
9ba2c09188 Assert that cpuid is available - this is just done to force the
code from cpuid.S to be pulled in so that tools can use it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3505
2005-04-02 17:01:52 +00:00
Tom Hughes
488b74dad3 Get VG_(has_cpuid) and VG_(cpuid) working on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3504
2005-04-02 17:01:07 +00:00
Tom Hughes
8ab17244a8 Add VGP_(setup_redirects) to the platform specific layers and use
it to setup vsyscall redirects on amd64 and the _dl_sysinfo_int80
redirect on x86.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3503
2005-04-02 15:53:01 +00:00
Tom Hughes
1f84a3f9ad It seems deref_UInt is fine - socklen_t is a 32 bit value on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3502
2005-04-02 15:04:15 +00:00
Tom Hughes
43c5476c8c Don't truncate symbol values in ELF symbol tables.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3501
2005-04-02 14:57:43 +00:00
Tom Hughes
1402d02a6e Remove a coupld of entries that have been dealt with.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3500
2005-04-02 14:46:54 +00:00
Tom Hughes
938b22c9c2 Even more amd64 system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3499
2005-04-02 11:39:56 +00:00
Tom Hughes
6f26888fd7 Yet more amd64 system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3498
2005-04-01 23:38:37 +00:00
Tom Hughes
e29c8a9ebd More amd64 system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3497
2005-04-01 23:22:36 +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
Tom Hughes
446ea57895 Rework the vsyscall redirections to work in pie code - the old form
seemed to completely confuse the compiler and it was generating
nonsense code to get the address of the replacement routines.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3495
2005-04-01 18:58:09 +00:00
Tom Hughes
aef0e2326c Run "make all" before "make install" as older versions of automake
don't put a dependency between the install target and $(BUILT_SOURCES)
so doing a straight install doesn't work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3494
2005-04-01 08:07:54 +00:00
Tom Hughes
61ca56765a Move the gettid system call to the linux specific section.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3493
2005-03-31 16:02:07 +00:00
Julian Seward
6109ce1fb4 Increase maximum translation size. This can happen when translating
long sequences of x86 insns with IR optimisation disabled, so the
tag-checking crap doesn't get knocked out like it usually does.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3492
2005-03-31 15:48:57 +00:00