43 Commits

Author SHA1 Message Date
Nicholas Nethercote
ce82c07580 Cleaned up reading of debug info a bit.
Renamed:
  VG_(read_procselfmaps_contents)() --> VG_(read_procselfmaps)()
  VG_(read_procselfmaps)()          --> VG_(parse_procselfmaps)()
  VG_(read_symbols)()               --> VG_(read_all_symbols)()
  VG_(read_symtab_callback)()       --> VG_(read_seg_symbols)()

Removed the Bool 'read_from_file' arg from (what is now)
VG_(parse_procselfmaps)().  If /proc/self/maps needs to be read beforehand, the
code calls (what is now) VG_(read_procselfmaps)() before.  Still using the
static buffer which is not nice but good enough.

More importantly, I split up VG_(new_exe_segment)() into
VG_(new_exeseg_startup)() and VG_(new_exeseg_mmap)().  This is because at
startup, we were stupidly calling VG_(read_symbols)() for every exe seg, which
parses /proc/self/maps completely in order to load the debug info/symbols for
the exe seg (and any others we haven't already got the symbols for).  Despite
the fact that the startup code reads /proc/self/maps to know which segments are
there at startup.  In other words, we were reading /proc/self/maps several
times more often than necessary, and there were nested reads, which Stephan
Kulow's recent depth patch fixed (but in a pretty hacky way;  this commit fixes
it properly).  So VG_(new_exeseg_startup)() now doesn't cause /proc/self/maps
to be re-read.  Unfortunately we do have to re-read /proc/self/maps for mmap(),
because we don't know the filename from the mmap() call (only the file
descriptor, which isn't enough).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1830
2003-09-25 17:54:11 +00:00
Julian Seward
dd2abcb8e0 In vg_memory.c, startup_segment_callback, fix initialisation ordering
problem which caused the leak checker to misbehave following recent
PLT-bypass workaround.

In short, it is an error to announce to the skin, segments found which
belong to the low-level memory manager, because the skin may then mark
them as accessible to the client.  This is wrong, and the client
should only acquire accessible memory via malloc etc and stack
movement.  Now we carefully avoid mentioning any segment belonging to
the low level memory manager.

Take the opportunity to improve VG_(within_m_state_static) so that it
also detects pointers within the thread table.  This can reduce the
number of blocks the leak checker spuriously thinks are still
reachable.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1751
2003-07-12 12:11:39 +00:00
Julian Seward
e4397da1ca A bit of cleaning up now that symbol table reading is no longer optional.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1745
2003-07-10 23:31:27 +00:00
Nicholas Nethercote
d7f0b75201 wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1631
2003-05-14 09:11:53 +00:00
Nicholas Nethercote
975948b452 wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1630
2003-05-14 09:08:49 +00:00
Julian Seward
c873dac6c4 Unchain translations when doing VALGRIND_DISCARD_TRANSLATIONS. Otherwise
the tt/tc are left in an inconsistent state afterwards.  (Adam Gundy
<arg@cyberscience.com>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1586
2003-05-04 12:32:56 +00:00
Nicholas Nethercote
ac7027c441 Updated copyright notices for 2003. Only 4 months late.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1526
2003-04-15 14:58:06 +00:00
Nicholas Nethercote
982fa6481a -----------------------------------------------------------------------------
overview
-----------------------------------------------------------------------------
Previously Valgrind had its own versions of malloc() et al that replaced
glibc's.  This is necessary for various reasons for Memcheck, but isn't needed,
and was actually detrimental, to some other skins.  I never managed to treat
this satisfactorily w.r.t the core/skin split.

Now I have.  If a skin needs to know about malloc() et al, it must provide its
own replacements.  But because this is not uncommon, the core provides a module
vg_replace_malloc.c which a skin can link with, which provides skeleton
definitions, to reduce the amount of work a skin must do.  The skeletons handle
the transfer of control from the simd CPU to the real CPU, and also the
--alignment, --sloppy-malloc and --trace-malloc options.  These skeleton
definitions subsequently call functions SK_(malloc), SK_(free), etc, which the
skin must define;  in these functions the skin can do the things it needs to do
about tracking heap blocks.

For skins that track extra info about malloc'd blocks -- previously done with
ShadowChunks -- there is a new file vg_hashtable.c that implements a
generic-ish hash table (using dodgy C-style inheritance using struct overlays)
which allows skins to continue doing this fairly easily.

Skins can also replace other functions too, eg. Memcheck has its own versions
of strcpy(), memcpy(), etc.

Overall, it's slightly more work now for skins that need to replace malloc(),
but other skins don't have to use Valgrind's malloc(), so they're getting a
"purer" program run, which is good, and most of the remaining rough edges from
the core/skin split have been removed.

-----------------------------------------------------------------------------
details
-----------------------------------------------------------------------------
Moved malloc() et al intercepts from vg_clientfuncs.c into vg_replace_malloc.c.
Skins can link to it if they want to replace malloc() and friends;  it does
some stuff then passes control to SK_(malloc)() et al which the skin must
define.  They can call VG_(cli_malloc)() and VG_(cli_free)() to do the actual
allocation/deallocation.  Redzone size for the client (the CLIENT arena) is
specified by the static variable VG_(vg_malloc_redzone_szB).
vg_replace_malloc.c thus represents a kind of "mantle" level service.

To get automake to build vg_replace_malloc.o, had to resort to a similar trick
as used for the demangler -- ask for a "no install" library (which is never
used) to be built from it.

Note that all malloc, calloc, realloc, builtin_new, builtin_vec_new, memalign
are now aware of --alignment, when running on simd CPU or real CPU.

This means the new_mem_heap, die_mem_heap, copy_mem_heap and ban_mem_heap
events no longer exist, since the core doesn't control malloc() any more, and
skins can watch for these events themselves.

This required moving all the ShadowChunk stuff out of the core, which meant
the sizeof_shadow_block ``need'' could be removed, yay -- it was a horrible
hack.  Now ShadowChunks are done with a generic HashTable type, in
vg_hashtable.c, which skins can "inherit from" (in a dodgy C-only fashion by
using structs with similar layouts).  Also, the free_list stuff was all moved
as a part of this.  Also, VgAllocKind was moved out of core into
Memcheck/Addrcheck and renamed MAC_AllocKind.

Moved these options out of core into vg_replace_malloc.c:
    --trace-malloc
    --sloppy-malloc
    --alignment

The alternative_free ``need'' could go, too, since Memcheck is now in complete
control of free(), yay -- another horribility.

The bad_free and free_mismatch events could go too, since they're now not
detected by core, yay -- yet another horribility.

Moved malloc() et al wrappers for Memcheck out of vg_clientmalloc.c into
mac_malloc_wrappers.c.  Helgrind has its own wrappers now too.

Introduced VG_USERREQ__CLIENT_CALL[123] client requests.  When a skin function
is operating on the simd CPU, this will call a given function and run it on the
real CPU.  The macros VG_NON_SIMD_CALL[123] in valgrind.h present a cleaner
interface to actually use.  Also introduce analogues of these that pass 'tst'
from the scheduler as the first arg to the called function -- needed for
MC_(client_malloc)() et al.

Fiddled with USERREQ_{MALLOC,FREE} etc. in vg_scheduler.c; they call
SK_({malloc,free})() which by default call VG_(cli_malloc)() -- can't call
glibc's malloc() here.  All the other default SK_(calloc)() etc. instantly
panic; there's a lock variable to ensure that the default SK_({malloc,free})()
are only called from the scheduler, which prevents a skin from forgetting to
override SK_({malloc,free})().  Got rid of the unused USERREQ_CALLOC,
USERREQ_BUILTIN_NEW, etc.

Moved special versions of strcpy/strlen, etc, memcpy() and memchr() into
mac_replace_strmem.c -- they are only necessary for memcheck, because the
hyper-optimised normal glibc versions confuse it, and for memcpy() etc. overlap
checking.

Also added dst/src overlap checks to strcpy(), memcpy(), strcat().  They are
reported not as proper errors, but just with single line warnings, as for silly
args to malloc() et al;  this is mainly because they're on the simulated CPU
and proper error handling would be a pain;  hopefully they're rare enough to
not be a problem.  The strcpy check is done after the copy, because it would
require counting the length of the string beforehand.  Also added strncpy() and
strncat(), which have overlap checks too.  Note that addrcheck doesn't do
overlap checking.

Put USERREQ__LOGMESSAGE in vg_skin.h to do the overlap check error messages.

After removing malloc() et al and strcpy() et al out of vg_clientfuncs.c, moved
the remaining three things (sigsuspend, VG_(__libc_freeres_wrapper),
__errno_location) into vg_intercept.c, since it contains things that run on the
simulated CPU too.  Removed vg_clientfuncs.c altogether.

Moved regression test "malloc3" out of corecheck into memcheck, since corecheck
no longer looks for silly (eg. negative) args to malloc().

Removed the m_eip, m_esp, m_ebp fields from the `Error' type.  They were being
set up, and then read immediately only once, only if GDB attachment was done.
So now they're just being held in local variables.  This saves 12 bytes per
Error.

Made replacement calloc() check for --sloppy-malloc;  previously it didn't.

Added "silly" negative size arg check to realloc(), it didn't have one.

Changed VG_(read_selfprocmaps)() so it can parse the file directly, or from a
previously read buffer.  Buffer can be filled with the new
VG_(read_selfprocmaps_contents)().  Using this at start-up to snapshot
/proc/self/maps before the skins do anything, and then parsing it once they
have done their setup stuff.  Skins can now safely call VG_(malloc)() in
SK_({pre,post}_clo_init)() without the mmap'd superblock erroneously being
identified as client memory.

Changed the --help usage message slightly, now divided into four sections: core
normal, skin normal, core debugging, skin debugging.  Changed the interface for
the command_line_options need slightly -- now two functions, VG_(print_usage)()
and VG_(print_debug_usage)(), and they do the printing themselves, instead of
just returning a string -- that's more flexible.

Removed DEBUG_CLIENTMALLOC code, it wasn't being used and was a pain.

Added a regression test testing leak suppressions (nanoleak_supp), and another
testing strcpy/memcpy/etc overlap warnings (overlap).

Also changed Addrcheck to link with the files shared with Memcheck, rather than
#including the .c files directly.

Commoned up a little more shared Addrcheck/Memcheck code, for the usage
message, and initialisation/finalisation.

Added a Bool param to VG_(unique_error)() dictating whether it should allow
GDB to be attached; for leak checks, because we don't want to attach GDB on
leak errors (causes seg faults).  A bit hacky, but it will do.

Had to change lots of the expected outputs from regression files now that
malloc() et al are in vg_replace_malloc.c rather than vg_clientfuncs.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1524
2003-04-15 13:03:23 +00:00
Nicholas Nethercote
594c7fc446 This commit moves some skin-specific stuff out of core, and generally
neatens other things up.

Also, it adds the --gen-suppressions option for automatically generating
suppressions for each error.

Note that it changes the core/skin interface:
SK_(dup_extra_and_update)() is replaced by SK_(update_extra)(), and
SK_(get_error_name)() and SK_(print_extra_suppression_info)() are added.


-----------------------------------------------------------------------------
details
-----------------------------------------------------------------------------
Removed ac_common.c -- it just #included another .c file;  moved the
#include into ac_main.c.

Introduced "mac_" prefixes for files shared between Addrcheck and Memcheck,
to make it clearer which code is shared.  Also using a "MAC_" prefix for
functions and variables and types that are shared.  Addrcheck doesn't see
the "MC_" prefix at all.

Factored out almost-identical mc_describe_addr() and describe_addr()
(AddrCheck's version) into MAC_(describe_addr)().

Got rid of the "pp_ExeContext" closure passed to SK_(pp_SkinError)(), it
wasn't really necessary.

Introduced MAC_(pp_shared_SkinError)() for the error printing code shared by
Addrcheck and Memcheck.  Fixed some bogus stuff in Addrcheck error messages
about "uninitialised bytes" (there because of an imperfect conversion from
Memcheck).

Moved the leak checker out of core (vg_memory.c), into mac_leakcheck.c.
 - This meant the hacky way of recording Leak errors, which was different to
   normal errors, could be changed to something better:  introduced a
   function VG_(unique_error)(), which unlike VG_(maybe_record_error)() just
   prints the error (unless suppressed) but doesn't record it.  Used for
   leaks;  a much better solution all round as it allowed me to remove a lot
   of almost-identical code from leak handling (is_suppressible_leak(),
   leaksupp_matches_callers()).

 - As part of this, changed the horrible SK_(dup_extra_and_update) into the
   slightly less horrible SK_(update_extra), which returns the size of the
   `extra' part for the core to duplicate.

 - Also renamed it from VG_(generic_detect_memory_leaks)() to
   MAC_(do_detect_memory_leaks).  In making the code nicer w.r.t suppressions
   and error reporting, I tied it a bit more closely to Memcheck/Addrcheck,
   and got rid of some of the args.  It's not really "generic" any more, but
   then it never really was.  (This could be undone, but there doesn't seem
   to be much point.)

STREQ and STREQN were #defined in several places, and in two different ways.
Made global macros VG_STREQ, VG_CLO_STREQ and VG_CLO_STREQN in vg_skin.h.

Added the --gen-suppressions code.  This required adding the functions
SK_(get_error_name)() and SK_(print_extra_suppression_info)() for skins that
use the error handling need.

Added documentation for --gen-suppressions, and fixed some other minor document
problems.

Various other minor related changes too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1517
2003-04-08 00:08:52 +00:00
Nicholas Nethercote
f360d3a384 -----------------------------------------------------------------------------
overview
-----------------------------------------------------------------------------
This commit introduces an optimisation that speeds up Memcheck by roughly
-3 -- 28%, and Addrcheck by 1 -- 36%, at least for the SPEC2000 benchmarks on
my 1400MHz Athlon.

Basic idea: that handling of A/V bit updates on %esp-adjustments was quite
sub-optimal -- for each "PUT ESP", a function was called that computed the
delta from the old and new ESPs, and then called a looping function to deal
with it.

Improvements:

  1. most of the time, the delta can be seen from the code.  So there's no need
     to compute it.

  2. when the delta is known, we can directly call a skin function to handle it.

  3. we can specialise for certain common cases (eg. +/- 4, 8, 12, 16, 32),
     including having unrolled loops for these.

This slightly bloats UCode because of setting up args for the call, and for
updating ESP in code (previously was done in the called C function).  Eg. for
`date' the code expansion ratio goes from 14.2 --> 14.6.  But it's much faster.

Note that skins don't have to use the specialised cases, they can just
define the ordinary case if they want;  the specialised cases are only used
if present.

-----------------------------------------------------------------------------
details
-----------------------------------------------------------------------------
Removed addrcheck/ac_common.c, put its (minimal) contents in ac_main.c.

Updated the major interface version, because this change isn't binary
compatible with the old core/skin interface.

Removed the hooks {new,die}_mem_stack_aligned, replaced with the better
{new,die}_mem_stack_{4,8,12,16,32}.  Still have the generic {die,new}_mem_stack
hooks.  These are called directly from UCode, thanks to a new pass that occurs
between instrumentation and register allocation (but only if the skin uses
these stack-adjustment hooks).  VG_(unknown_esp_update)() is called from UCode
for the generic case;  it determines if it's a stack switch, and calls the
generic {new,die}_stack_mem hooks accordingly.  This meant
synth_handle_esp_assignment() could be removed.

The new %esp-delta computation phase is in vg_translate.c.

In Memcheck and Addrcheck, added functions for updating the A and V bits of a
single aligned word and a single aligned doubleword.  These are called from the
specialised functions new_mem_stack_4, etc.  Could remove the one for the old
hooks new_mem_stack_aligned and die_mem_stack_aligned.

In mc_common.h, added a big macro containing the definitions of new_mem_stack_4
et al.  It's ``instantiated'' separately by Memcheck and Addrcheck.  The macro
is a bit klugey, but I did it that way because speed is vital for these
functions, so eg. a function pointer would have slowed things down.

Updated the built-in profiling events appropriately for the changes (removed
one old event, added a new one;  finding their names is left as an exercise for
the reader).

Fixed memory event profiling in {Addr,Mem}check, which had rotted.

A few other minor things.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1510
2003-04-07 14:40:25 +00:00
Julian Seward
a071ba39cb A minimal set of changes to make it work on Red Hat 9, at least in the
interim.  All hats off to Graydon Hoare for this, plus to whoever
devised the LD_ASSUME_KERNEL trapdoor.

This does not provide NPTL support.  Instead it turns out we can ask
for the old LinuxThreads interface to be used (wonderful!)

Other than that we have to deal with kernels with SYSINFO pages at the
top of memory.  No big deal, apparently.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1508
2003-04-06 12:23:27 +00:00
Julian Seward
481944a72c startup_segment_callback: Get rid of completely pointless check re
ASSUMED_EXE_BASE.  This is now pointless, and causes problems for people
using Clearcase, since it seems their shared objects may not follow
the convention that they end in .so.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1458
2003-03-15 20:01:21 +00:00
Julian Seward
79a981783a Implement suppressions for leak checks, which is a fairly frequently
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
2002-12-26 01:53:45 +00:00
Julian Seward
ab1d62f72f vg_scan_all_valid_memory: Don't prod any page unless we're sure we
need to.  Poking pages unnecessarily can cause a page fault which
under some rare circumstances can cause the kernel to extend the stack
segment all the way down to the poked page, which is seriously bad.

Fixes a bug shown by --trace-children=yes --skin=addrcheck
--leak-check=yes when running OpenOffice 1.0.1 on SuSE 8.1. This
distro seems to run with no stack limit, which is one prerequisite of
this bug.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1386
2002-12-22 19:11:14 +00:00
Julian Seward
0eb8992e42 Remove spurious \n in message.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1382
2002-12-15 13:35:40 +00:00
Julian Seward
2340d0cc7f VG_(handle_esp_assignment): merge two conditional jumps into one on
common path.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1368
2002-12-14 23:18:06 +00:00
Julian Seward
1a7bcea085 sort_malloc_shadows: check a loop bound in establishing initial shellsort
step size.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1286
2002-11-11 08:36:52 +00:00
Julian Seward
d8810836f8 Fix error due to use of = as comparison, rather than ==, in profiling.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1285
2002-11-11 08:32:06 +00:00
Julian Seward
976b63337a Common up leak detection stuff which was previously duplicated in Memcheck
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
2002-10-21 07:29:59 +00:00
Julian Seward
3ea39b94d1 startup_segment_callback: don't panic when faced with non-executable,
non-readable, non-writable sections.  Just ignore them.  Comment in
the 1.0.X sources to the effect that this never happens is evidently a
lie.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1203
2002-10-06 00:28:21 +00:00
Julian Seward
88f5f0f178 Fix compile warnings
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1195
2002-10-05 15:28:29 +00:00
Nicholas Nethercote
24e24c44aa wibbles
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1184
2002-10-04 15:30:48 +00:00
Nicholas Nethercote
089e7e3bcb Updated file descriptions in the copyright notices to reflect the core/skin
split.  Each skin now has its own two-line description.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1166
2002-10-02 13:26:35 +00:00
Nicholas Nethercote
41a0bcbbbb Changes made so that skin error "report this bug to" messages are distinguished
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
2002-10-02 11:08:25 +00:00
Julian Seward
d4d384d7ba Improve stack-switch-handling logic following discussion with John Regehr.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1157
2002-10-02 01:38:40 +00:00
Julian Seward
b362551b31 VG_(handle_esp_assignment): reinstate kludge for detecting and
handling user-space stack switching.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1154
2002-10-01 09:09:23 +00:00
Nicholas Nethercote
afebe61b37 Files updated, added and removed in order to turn the ERASER branch into HEAD
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1086
2002-09-23 09:36:25 +00:00
Julian Seward
b53529ecb5 Support for x86 insn fldenv.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@515
2002-07-23 18:48:39 +00:00
Julian Seward
f485f3c6dd Implement fnstenv (store FPU environment, but not regs AIUI)
(Jeff Epler)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@492
2002-07-13 12:27:12 +00:00
Julian Seward
46e09a22f6 Minor mods to stop make the leak detector behave properly for the
following kind of stupid test program
   int main (void) { char* a = malloc(100); return 0; }
which many people seem fond of trying for some reason.
In general the leak detector works fine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@387
2002-06-05 20:28:33 +00:00
Julian Seward
5bf4e3319d Remove valgrind's use of libc-supplied stat() and sbrk(). Now the only
sysbols we need from libc are __umoddi3 and __udivdi3 ; other than that
valgrind.so is completely self-contained.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@244
2002-05-09 17:38:13 +00:00
Julian Seward
b9c76f1080 Actually call VG_(first_and_last_secondaries_look_plausible) and make
assertions about the return value, rather than asserting the
non-NULL-ness of the function's address :) Classic beginner's mistake,
compounded by C's crappy (non-existent) type system, which allows me
to silently confuse Bool with Pointer-to-Function.  What a great
programming language.  Come back Haskell, all is forgiven.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@228
2002-05-07 23:45:03 +00:00
Julian Seward
6a3788061f Generate better ucode for back-to-back sequences of register pushes and
pops, as appear at function prologues/epilogues.  Specifically, update %ESP
just once for the whole sequence.  This reduces by about 20% the number
of calls to handle_esp_assignment (for kate in KDE 3.0, -O), which is a
good thing since that is quite expensive.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@227
2002-05-07 23:38:30 +00:00
Julian Seward
3cc89028c1 Fix really stupid use of uninitialised value introduced in rev 1.8.
Basically this bug invalidates all snapshots from 0501 until now.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@212
2002-05-04 12:59:03 +00:00
Julian Seward
78998c4d1a Ensure that values returned to the client from pthread operations are
marked as defined, so as to avoid spurious uninit-value errors.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@185
2002-05-01 03:24:23 +00:00
Julian Seward
cd4b1c10a2 Reinstate use of VG_(do_sanity_checks), although at a lower frequency
than before.  Turns out they were wasting 25-50% of total execution
time in valgrinds of the 200203XX vintage.  Apologies, KDE hackers!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@182
2002-05-01 01:58:35 +00:00
Julian Seward
f6f515f0b8 Yay! Opera (6.0TP2) now works.
Various enhancements:

* Make the error message system more thread-aware.

* Fix stupid bug in do_pthread_create causing incorrect initial
  %ESP values sometimes.

* Fix various other minor things needed to make opera work.

Performance of threaded apps is pretty terrible.  This needs
looking into.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@98
2002-04-18 11:37:52 +00:00
Julian Seward
93b2c2ed95 Get rid of the muraroa.demon.co.uk references since that account is
soon to disappear.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@83
2002-04-16 02:51:05 +00:00
Julian Seward
6885b33e91 * external namespace check
* VG_(printf) format strings check


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@65
2002-04-14 13:01:38 +00:00
Julian Seward
8138f264e0 Plumb the right %EIP and %EBP values through to VG_(get_ExeContext)
now that we have the additional complication of multiple threads.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@64
2002-04-14 04:16:48 +00:00
Julian Seward
7a36f60133 Mega-merge of my last 2 weeks hacking. This basically does the groundwork
for pthread_* support.  Major changes:

* Valgrind now contains a (skeletal!) user-space pthreads
  implementation.  The exciting bits are in new file vg_scheduler.c.
  This contains thread management and scheduling, including nasty crud
  to do with making some syscalls (read,write,nanosleep) nonblocking.
  Also implementation of pthread_ functions: create join
  mutex_{create,destroy,lock,unlock} and cancel.

* As a side effect of the above, major improvements to signal handling
  and to the client-request machinery.  This is now used to intercept
  malloc/free etc too; the hacky way this is done before is gone.
  Another side effect is that vg_dispatch.S is greatly simplified.
  Also, the horrible hacks to do with delivering signals to threads
  blocked in syscalls are gone, since the new mechanisms cover this case
  easily.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@52
2002-04-12 11:12:52 +00:00
Julian Seward
6b710076fa Print suggested fix to avoid this panic:
VG_ASSUMED_EXE_BASE doesn't match reality


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@23
2002-03-24 12:03:00 +00:00
Julian Seward
72a784f3b1 Initial revision
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2
2002-03-22 01:27:54 +00:00