Commit Graph

455 Commits

Author SHA1 Message Date
Nicholas Nethercote
54f153c1da Cache simulation requires strict INCEIP updating so that the boundaries between
individual x86 instructions can be found when instrumenting UCode.  However,
EIP is not needed during execution, because the x86 instr addresses are copied
into the cost-centres.  So now they INCEIPs are removed during the
instrumentation step once their task is done.

This reduces running times by about 3--7%, and translation sizes by about 9%
(code expansion reduced from about 11x to about 10x).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@550
2002-08-01 08:09:51 +00:00
Dirk Mueller
cf0dafe8ef Trying to support the new C++ ABI of gcc 3.x
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@549
2002-07-29 20:42:39 +00:00
Nicholas Nethercote
252fb3fba9 This commit introduces two new UInstructions: CCALL_1_0, CCALL_2_0.
These are the first of a generic family for calling C functions.  CCALL_M_N
calls a function with M word-sized arguments and N word-sized return values
(N == 0 or 1, of course).  All stack management is done automatically --
register saving, argument pushing, register restoring.  Rough timings show it's
marginally faster (~3%), probably because the instrumentation phase is slightly
simpler and translations are slighly more compact.

It was introduced because the way Cachegrind was calling its helper functions
was not really legitimate -- it involved pushing RealRegs at a point where
RealRegs shouldn't have been used.  This flukily worked for Cachegrind, but
caused obscure seg faults when I tried using the same technique for the DIDUCE
stuff.  Hence this more general approach.

CCALL_M_N where M+N <= 3 are easy.  More args might be done by abusing spare
fields in the UInstr struct, if really necessary.  But it's not, yet.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@546
2002-07-28 09:53:34 +00:00
Julian Seward
ecd4ee7a79 Wibbles for 1.0.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@540
2002-07-26 11:34:39 +00:00
Julian Seward
4f5ab3f6c2 Only run __libc_freeres() when valgrinding. It may do invalid free()s
which cause the low-level memory manager to crash.  When valgrinding
that's all protected, but not when cachegrinding etc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@537
2002-07-26 10:52:48 +00:00
Julian Seward
2891d464fe Final caveats for 1.0.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@536
2002-07-25 22:45:35 +00:00
Julian Seward
629c5e8934 --> 1.0.0 (yay!)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@535
2002-07-25 22:42:06 +00:00
Julian Seward
694e83d6fb Print more helpful message on JIT failure to handle insns starting with 0x0F.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@532
2002-07-25 22:41:40 +00:00
Julian Seward
7b636956df Suppressions for R H Limbo (7.3.92)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@531
2002-07-25 02:21:53 +00:00
Julian Seward
c88159307c Implement __NR_getxattr.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@530
2002-07-25 01:41:01 +00:00
Julian Seward
db16040de4 Track ELF frame changes as appearing in Red Hat Limbo (7.3.92).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@525
2002-07-25 00:49:51 +00:00
Julian Seward
44766a20ca Compile fixes for Red Hat Limbo (7.3.92).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@522
2002-07-24 09:41:52 +00:00
Julian Seward
bf212498f5 Some jokers apparently like setting the CPU's AC (Alignment Check) flag
for god-knows-why reasons.  This causes VG_{READ,WRITE}_MISALIGNED_WORD
to give bus errors.  Redefine them to do the obvious byte-by-byte loads/
stores.  Fortunately they are not performance critical.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@519
2002-07-24 09:36:36 +00:00
Julian Seward
51c33c4afd Assume PUTF modifies %EFLAGS in a completely arbitrary manner, and so
be completely pessimistic if it is encountered during the redundant-flag-
save/restore-elimination pass.  This fixes the following mysterious
failure:

 insane instruction
           27: PUTFL     %ecx

 valgrind: vg_from_ucode.c:2600 (vgPlain_emit_code): Assertion `sane' failed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@516
2002-07-24 09:33:52 +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
8f8ecbe8aa Skip directly to 1.0pre6 to avoid confusing me.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@514
2002-07-16 02:13:30 +00:00
Julian Seward
691e854037 Add a suppression to deal with calling __libc_freeres().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@513
2002-07-16 02:11:51 +00:00
Julian Seward
5b87b4d8a7 Document probs with gcc-3.1 false positives.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@512
2002-07-16 01:49:22 +00:00
Julian Seward
67a4c735a2 At request of Ulrich Drepper, call __libc_freeres() after final __NR_exit
so as to free memory allocated by glibc.  This reduces the leaks reported
in glibc, but causes a stack of read/write-after-free errors which have
to be suppressed :-(


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@507
2002-07-16 01:43:15 +00:00
Dirk Mueller
157ebdd5b0 possible fix for valgrinding problem on longer running kernels (2.4.18-SuSE, update 17 days)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@506
2002-07-15 19:39:51 +00:00
Julian Seward
30b5f40529 Suppress errors in __rawmemchr when called from anywhere at all.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@505
2002-07-14 13:04:38 +00:00
Julian Seward
ee99a560ad Mention kernel probs with R H "Limbo" public beta (hacked 2.4.18).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@504
2002-07-14 10:45:21 +00:00
Julian Seward
fb00a3330d Document some limitations.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@503
2002-07-13 14:09:35 +00:00
Julian Seward
d8657c6cb0 ---> 1.0pre5
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@502
2002-07-13 13:45:28 +00:00
Julian Seward
c20e620efa get_caches(): ensure caches are initialised on targets where
get_caches_from_CPUID fails.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@501
2002-07-13 13:31:20 +00:00
Julian Seward
66d6958565 Copy pthread_rwlockattr_setpshared verbatim from LinuxThreads.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@498
2002-07-13 12:58:44 +00:00
Julian Seward
3fa11cef68 Add __NR_quotactl.
Allow NULL 3rd arg in __NR_sendfile.
("Didier")


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@497
2002-07-13 12:58:08 +00:00
Julian Seward
7b7227adc8 Include valgrind.spec and valgrind.spec.in in tarballs.
Also add a line to the description in the .spec.in.
(Shlomi Fish)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@494
2002-07-13 12:37:28 +00:00
Julian Seward
344e4348de (Tim Rowley, verbatim)
The Intel p4 manual suggests inserting a pause instruction in
spin-wait loops as a hint to what the code is doing.  In other
respects it acts just like a nop.  Pause (0xF3 0x90) currently
causes valgrind to panic.  The patch below keeps things running.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@493
2002-07-13 12:32:16 +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
2349ee6191 Print additional useful information immediately prior to
VG_(panic)("VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) failed\n");


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@491
2002-07-13 12:20:35 +00:00
Julian Seward
27c607b91f vg_signals.c: vg_oursignalhandler(): don't longjmp() on fatal signal if
the scheduler's jmp_buf is not valid.  This might avoid at least some
of the following:
   vg_scheduler.c:479 (run_thread_for_a_while): Assertion `trc == 0'
   failed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@490
2002-07-13 12:12:56 +00:00
Julian Seward
4ea574f4f0 Make sigsuspend() work well enough to keep zsh hackers happy.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@489
2002-07-13 11:05:45 +00:00
Julian Seward
e5a8caf44e Make VG_USERREQ__PTHREAD_YIELD actually yield the thread. This used
to work but was broken in a subtle way by the cleanup of rev 1.70.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@488
2002-07-12 22:30:51 +00:00
Julian Seward
e666ed6444 Check for signals to be delivered after every syscall. This avoids
some obscure deadlock cases.  (Neil Conway).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@487
2002-07-12 01:23:03 +00:00
Julian Seward
3bf5e6d313 Add comments about syscall wrapper problems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@484
2002-07-01 10:59:17 +00:00
Julian Seward
00680785e3 ---> 1.0pre4
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@483
2002-07-01 10:50:44 +00:00
Julian Seward
2709e5a7f9 Add helpful info for package builders.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@482
2002-07-01 08:46:27 +00:00
Julian Seward
6764cec920 Final documentation updates for 1.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@481
2002-07-01 08:30:05 +00:00
Julian Seward
e8dd1efe84 Implement --weird-hacks=truncate-writes to limit the size of write syscalls
to 4096, to possibly avoid deadlocks under very rare circumstances.
Is fully documented and commented.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@479
2002-06-30 12:44:54 +00:00
Julian Seward
5bf10a3618 cleanup_after_thread_exited: also clean up the waiting_fds table on thread
disappearance.  This fixes an assertion failure to do with thread nukage
on fork():
   vg_scheduler.c:936 (poll_for_ready_fds):
   Assertion `vgPlain_is_valid_tid(tid)' failed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@478
2002-06-30 10:57:30 +00:00
Julian Seward
c3c3b1e909 Make --stop-after= work again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@475
2002-06-28 02:08:28 +00:00
Julian Seward
58a54b1f84 ---> 1.0pre3
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@474
2002-06-28 01:46:56 +00:00
Julian Seward
ac5e011028 Finally get around to implementing pthread_atfork.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@473
2002-06-28 01:46:26 +00:00
Nicholas Nethercote
e95cef5f3c Removed line about Cachegrind being experimental.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@472
2002-06-27 15:45:09 +00:00
Julian Seward
2ccd1ed4e9 Partial implementation of mallinfo() (Ilpo Ruotsalainen)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@470
2002-06-26 17:08:01 +00:00
Julian Seward
0a530cb06c parse_cache_opt: Move free() of opt past last use.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@469
2002-06-26 17:02:57 +00:00
Nicholas Nethercote
7857877374 Forgot to VG_(free) a VG_(strdup)'d string.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@468
2002-06-26 10:06:26 +00:00
Julian Seward
a077c2c8ac Make __pthread_clock_gettime and __pthread_clock_settime appear for
GLIBC_2.2.3.  I dunno what this means, if anything, but someone
reports it helps.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@467
2002-06-26 00:50:36 +00:00
Julian Seward
827b3d2565 select() and poll(): change order of events in main timing loop
so that very short selects/polls don't just cause a timeout with
no real test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@466
2002-06-26 00:47:17 +00:00