2695 Commits

Author SHA1 Message Date
Julian Seward
a16787b1b5 More printing fine-tuning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3562
2005-04-25 02:37:56 +00:00
Julian Seward
638c3a1240 Print debugging info at various places in the startup sequence.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3561
2005-04-25 02:05:54 +00:00
Julian Seward
920e4c17ad Print a bit more prettily.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3560
2005-04-25 02:04:54 +00:00
Julian Seward
487756039c Add a new module: the debug-logger. For a while now, we've used the
same logging mechanism to emit both end-user messages and debugging-
valgrind-itself messages.  This commit creates a new mechanism for the
latter purpose.

The main feature of m_debuglog is that it has zero dependencies on any
other module and therefore can safely operate all the way through
stage1 and stage2 startup.  It is restricted to emitting debug info on
file descriptor 2 (stderr), but that's not a big deal.

As a result of this change the basic formatted-print routines
(vprintf) have been moved from vg_mylibc.c into m_debuglog, so that
m_debuglog remains standalone.

The %y format string is currently disabled, since supporting it ("show
symbol corresponding to this address") would create a dependency from
m_debuglog to the entire debug-info reading machinery and all the
stuff that depends on, thereby making a nonsense of m_debuglog being
standalone.  Its omission does not seem to cause any regression tests
to fail, though.

The debug logger is activated with "-d".  More "-d"s make it more
verbose.

m_debuglog.o is linked into both stage1 and stage2, but as it is
completely standalone this causes no particular problems.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3559
2005-04-25 01:36:56 +00:00
Julian Seward
7a5882a9b1 Relax the requirement that a pub_tool_<modulename>.h file must exist
even if it defines nothing.  That's a bit silly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3558
2005-04-24 14:34:42 +00:00
Julian Seward
0d4f070b04 Make amd64-linux build again after m_sigframe hackery.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3557
2005-04-24 14:31:29 +00:00
Julian Seward
48d6381e24 Create a new module, "sigframe", responsible for creating/destroying
signal frames.  This commit looks worse than it is -- really just a
load of moving-code-around.

This is the first multiple-implementation module, in that it has a
single interface (pub_core_sigframe.h) but multiple implementations,
depending on the os-cpu pair.  All the grotty details are hidden in
the implementation in m_sigframe/; callers need be aware only of the
interface.  Yay.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3556
2005-04-24 14:18:14 +00:00
Julian Seward
4ea28e5187 Rename the first three modules as per naming scheme.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3555
2005-04-24 12:33:12 +00:00
Julian Seward
b277eef67d Add statement-of-intent re top level module structure.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3554
2005-04-24 12:19:13 +00:00
Julian Seward
c9356b36be Add initialisation-order sanity checks.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3553
2005-04-24 11:22:44 +00:00
Julian Seward
d82491f9da Update comment about stack management, and remove some unused
functions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3552
2005-04-24 11:05:55 +00:00
Julian Seward
8ee1f7bca4 A leftover from the days of our own libpthread; now irrelevant.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3551
2005-04-24 10:41:53 +00:00
Nicholas Nethercote
a12089811a Inline function that's only used once.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3550
2005-04-24 00:21:01 +00:00
Julian Seward
78e24d41bd Add intercepts for operator new(unsigned long) and operator
new[](unsigned long).  The 32-bit ones take unsigned int args, not
unsigned longs, and so the existing name-set did not capture them.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3549
2005-04-24 00:04:42 +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
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