]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
23 years agoAdd debugging hooks, currently disabled.
Julian Seward [Wed, 1 May 2002 00:05:27 +0000 (00:05 +0000)] 
Add debugging hooks, currently disabled.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@178

23 years agoFix typo to do with rwlock aliasing.
Julian Seward [Wed, 1 May 2002 00:03:16 +0000 (00:03 +0000)] 
Fix typo to do with rwlock aliasing.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@177

23 years agovg_symtab2.c:
Nicholas Nethercote [Tue, 30 Apr 2002 13:44:01 +0000 (13:44 +0000)] 
vg_symtab2.c:
    Discovered sometimes a SLINE stabs entry is the last one (which broke an
    assertion).  In such a case, we must guess the line's instruction address
    range -- I've guessed 4, arbitrarily.

vg_cachegen.in, vg_cachesim_{I1,D1,L2}.c:
    Discovered a bad bug in the cache simulation:  when determining if a
    references straddles two memory blocks, to find the end of the range I was
    adding 'size' to the base address, rather than 'size - 1'.  This was
    causing way too many straddled references, which would inflate the miss
    counts.

vg_cachesim.c:
    Minor stuff

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@176

23 years agoAdded note about bts/btr/btc causing bogus cache read counts.
Nicholas Nethercote [Tue, 30 Apr 2002 12:46:22 +0000 (12:46 +0000)] 
Added note about bts/btr/btc causing bogus cache read counts.
Added to todo list note about files with > 65536 lines.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@175

23 years agoRight-justifying event names instead of left-justifying; easier to read when
Nicholas Nethercote [Tue, 30 Apr 2002 11:34:54 +0000 (11:34 +0000)] 
Right-justifying event names instead of left-justifying;  easier to read when
large numbers are involved and the columns are wide.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@174

23 years ago---> 20020430
Julian Seward [Tue, 30 Apr 2002 11:12:00 +0000 (11:12 +0000)] 
---> 20020430

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@173

23 years agoMake pthread_mutexattr_setkind_np be an alias of__pthread_mutexattr_settype.
Julian Seward [Tue, 30 Apr 2002 10:20:10 +0000 (10:20 +0000)] 
Make pthread_mutexattr_setkind_np be an alias of__pthread_mutexattr_settype.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@172

23 years agoRelax assertion to avoid this: vg_cachesim.c:402
Julian Seward [Tue, 30 Apr 2002 10:18:48 +0000 (10:18 +0000)] 
Relax assertion to avoid this: vg_cachesim.c:402
(compute_BBCC_array_size): Assertion `!is_STORE && !is_FPU_R &&
!is_FPU_W' failed.

I don't know if this is correct, but I can run kate having done so.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@171

23 years agovg_improve() -- the ucode optimiser: consistently apply the
Julian Seward [Tue, 30 Apr 2002 00:29:36 +0000 (00:29 +0000)] 
vg_improve() -- the ucode optimiser: consistently apply the
no-deferred-updates of %ESP rule, regardless of end use of the ucode.
This seems more consistent, and was exposed following examination of
code causing an assertion failure in the cache profiler.  Added an
assertion to check this too, and was surprised I hadn't had an
assertion there in the first place.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@170

23 years agoConfig/build/install vg_annotate and vg_cachegen correctly.
Julian Seward [Mon, 29 Apr 2002 17:27:07 +0000 (17:27 +0000)] 
Config/build/install vg_annotate and vg_cachegen correctly.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@169

23 years agoNew files:
Nicholas Nethercote [Mon, 29 Apr 2002 16:03:24 +0000 (16:03 +0000)] 
New files:
  - vg_cachesim.c
  - vg_cachesim_{I1,D1,L2}.c
  - vg_annotate.in
  - vg_cachegen.in

Changes to existing files:

  - valgrind/valgrind.in, added option:

        --cachesim=no|yes       [no]

  - Makefile/Makefile.am:
        * added vg_cachesim.c to valgrind_so_SOURCES var
        * added vg_cachesim_I1.c, vg_cachesim_D1.c, vg_cachesim_L2.c to
          noinst_HEADERS var
        * added vg_annotate, vg_cachegen to 'bin_SCRIPTS' var, and added empty
          targets for them

  - vg_main.c:
        * added two offsets for cache sim functions (put in positions 17a,17b)
        * added option handling (detection of --cachesim=yes which turns off of
          --instrument);
        * added calls to cachesim initialisation/finalisation functions

  - vg_mylibc: added some system call wrappers (for chmod, open_write, etc) for
    file writing

  - vg_symtab2.c:
        * allow it to read symbols if either of --instrument or --cachesim is
          used
        * made vg_symtab2.c:vg_what_{line,fn}_is_this extern, renaming it as
          VG_(what_line_is_this) (and added to vg_include.h)
        * completely rewrote the read loop in vg_read_lib_symbols, fixing
          several bugs.  Much better now, although probably not perfect.  It's
          also relatively fragile -- I'm using the "die immediately if anything
          unexpected happens" approach.

  - vg_to_ucode.c:
        * in VG_(disBB), patching in x86 instruction size into extra4b field of
          JMP instructions at the end of basic blocks if --cachesim=yes.
          Shifted things around to do this;  also had to fiddle around with
          single-step stuff to get this to work, by not sticking extra JMPs on
          the end of the single-instruction block if there was already one
          there (to avoid breaking an assertion in vg_cachesim.c).  Did a
          similar thing to avoid an extra JMP on huge basic blocks that are
          split.

  - vg_translate.c:
        * if --cachesim=yes call the cachesim instrumentation phase
        * made some functions extern and renamed:
                allocCodeBlock() --> VG_(allocCodeBlock)()
                freeCodeBlock()  --> VG_(freeCodeBlock)()
                copyUInstr()     --> VG_(copyUInstr)()
          (added to vg_include.h too)

  - vg_include.c: declared
        * cachesim offsets
        * exports of vg_cachesim.c
        * added four new profiling events (increasing VGP_M_CCS to 24 -- I kept
          the spare ones)
        * added comment about UInstr.extra4b field being used for instr size in
          JMPs for cache simulation

  - docs/manual.html:
        * Added --cachesim option to section 2.5.
        * Added cache profiling stuff as section 7.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@168

23 years ago---> 20020429
Julian Seward [Mon, 29 Apr 2002 12:39:17 +0000 (12:39 +0000)] 
---> 20020429

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@166

23 years agoFix really stupid error in computation of timeout point in nonblocking
Julian Seward [Mon, 29 Apr 2002 12:20:34 +0000 (12:20 +0000)] 
Fix really stupid error in computation of timeout point in nonblocking
poll().  After this change, Mozilla-0.9.2.1 and Galeon 0.11.3 finally
behave reasonably on my box.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@165

23 years agoFix a subtle (?) bug in sched_do_syscall to with read/write calls for
Julian Seward [Mon, 29 Apr 2002 01:58:08 +0000 (01:58 +0000)] 
Fix a subtle (?) bug in sched_do_syscall to with read/write calls for
which the client has already got the fd in nonblocking mode.  In such
cases, do not wait for an IO completion -- since the client presumably
handles that somehow.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@164

23 years agoCDROM ioctls. (Lionel Ulmer)
Julian Seward [Sat, 27 Apr 2002 02:28:19 +0000 (02:28 +0000)] 
CDROM ioctls.  (Lionel Ulmer)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@163

23 years agoioctls for /dev/rtc (Fredrik Kuivinen)
Julian Seward [Sat, 27 Apr 2002 02:20:14 +0000 (02:20 +0000)] 
ioctls for /dev/rtc (Fredrik Kuivinen)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@162

23 years agoAdd __NR_getpriority (Richard Boulton).
Julian Seward [Sat, 27 Apr 2002 02:13:24 +0000 (02:13 +0000)] 
Add __NR_getpriority (Richard Boulton).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@161

23 years agoUse safe_dereference in IPCOP_msgrcv. (Tom Hughes)
Julian Seward [Sat, 27 Apr 2002 02:06:15 +0000 (02:06 +0000)] 
Use safe_dereference in IPCOP_msgrcv.  (Tom Hughes)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@160

23 years agoDo __NR_sched_get_priority_min and __NR_setpriority (Cody Russell).
Julian Seward [Sat, 27 Apr 2002 01:56:30 +0000 (01:56 +0000)] 
Do __NR_sched_get_priority_min and __NR_setpriority (Cody Russell).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@159

23 years agoAllow apparently invalid keys in libc_internal_tsd_{get,set}. This
Julian Seward [Sat, 27 Apr 2002 01:35:38 +0000 (01:35 +0000)] 
Allow apparently invalid keys in libc_internal_tsd_{get,set}.  This
allows koffice-1.2beta1 to work.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@158

23 years agohandle_signal_return: when a waiting read/write syscall is interrupted
Julian Seward [Fri, 26 Apr 2002 22:47:57 +0000 (22:47 +0000)] 
handle_signal_return: when a waiting read/write syscall is interrupted
by a signal which has been set to non-SARESTART, clean up the waiting_fds
table correctly.

xemacs (cvs, --pdump only) now works.  Yay!

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@157

23 years agoFix more stuff broken by recent exported-symbol hackery.
Julian Seward [Fri, 26 Apr 2002 21:01:13 +0000 (21:01 +0000)] 
Fix more stuff broken by recent exported-symbol hackery.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@156

23 years agoFinish first pass of the symbols cleanup. Only versioned symbols remain
Julian Seward [Fri, 26 Apr 2002 14:31:40 +0000 (14:31 +0000)] 
Finish first pass of the symbols cleanup.  Only versioned symbols remain
to do.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@155

23 years agoAdministrivia.
Julian Seward [Fri, 26 Apr 2002 14:30:52 +0000 (14:30 +0000)] 
Administrivia.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@154

23 years agoMess around with aliases to make the exported T/D/W syms look like those
Julian Seward [Fri, 26 Apr 2002 13:25:00 +0000 (13:25 +0000)] 
Mess around with aliases to make the exported T/D/W syms look like those
of the real libpthread.so.  This is a Good Thing, despite the fact it
temporarily breaks some threaded programs.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@153

23 years agoA simple script to help me ensure that my libpthread.so looks
Julian Seward [Fri, 26 Apr 2002 11:50:43 +0000 (11:50 +0000)] 
A simple script to help me ensure that my libpthread.so looks
from the outside, to the linker, identical to the original.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@152

23 years agoFix many holes and bugs in an attempt to get my libpthread.so to export
Julian Seward [Fri, 26 Apr 2002 03:28:18 +0000 (03:28 +0000)] 
Fix many holes and bugs in an attempt to get my libpthread.so to export
the same set of symbols as the real one, which I now realise is crucial
for it to work at all.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@151

23 years agoFix various bugs getting in the way of licq starting up.
Julian Seward [Fri, 26 Apr 2002 00:27:53 +0000 (00:27 +0000)] 
Fix various bugs getting in the way of licq starting up.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@150

23 years agoTry and give at least some minimal binding for all functions exported
Julian Seward [Thu, 25 Apr 2002 20:17:29 +0000 (20:17 +0000)] 
Try and give at least some minimal binding for all functions exported
by the real libpthread.so.  In the process fix a bunch of stuff, including
adding thread-specific h_errno and resolver state storage.  This fixes
licq crashing at startup.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@149

23 years agoJiggle timing delays yet again.
Julian Seward [Thu, 25 Apr 2002 01:33:50 +0000 (01:33 +0000)] 
Jiggle timing delays yet again.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@148

23 years ago* Performance enhancements: put syscalls and pthread_getspecific in
Julian Seward [Thu, 25 Apr 2002 01:32:10 +0000 (01:32 +0000)] 
* Performance enhancements: put syscalls and pthread_getspecific in
  fast path.

* Jiggle timing intervals yet again, probably completely pointless.

* Teach the scheduler that a thread in cond_timedwait is in a bounded
  wait.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@147

23 years agoDefine VKI_SIGUSR1.
Julian Seward [Thu, 25 Apr 2002 01:29:35 +0000 (01:29 +0000)] 
Define VKI_SIGUSR1.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@146

23 years agoDebugging hook which turns on a lot of debug printing when SIGUSR1
Julian Seward [Thu, 25 Apr 2002 01:27:35 +0000 (01:27 +0000)] 
Debugging hook which turns on a lot of debug printing when SIGUSR1
arrives.  Commented out.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@145

23 years ago---> 20020425
Julian Seward [Thu, 25 Apr 2002 01:24:42 +0000 (01:24 +0000)] 
---> 20020425

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@144

23 years agoBack out rev 1.10. It can't possibly be the right fix.
Julian Seward [Wed, 24 Apr 2002 21:44:17 +0000 (21:44 +0000)] 
Back out rev 1.10.  It can't possibly be the right fix.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@143

23 years agoVG_(oursignalhandler): when catching a fatal signal, don't longjmp
Julian Seward [Wed, 24 Apr 2002 21:39:11 +0000 (21:39 +0000)] 
VG_(oursignalhandler): when catching a fatal signal, don't longjmp
back to the scheduler if the signal is already pending.  There's
something very suspicious about all this, though.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@142

23 years agoGet rid of incomprehensible special-case treatment of SIGABRT.
Julian Seward [Wed, 24 Apr 2002 21:25:46 +0000 (21:25 +0000)] 
Get rid of incomprehensible special-case treatment of SIGABRT.
Might have made sense once but it doesn't any more.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@141

23 years agoadjust error count thresholds
Julian Seward [Wed, 24 Apr 2002 21:24:18 +0000 (21:24 +0000)] 
adjust error count thresholds

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@140

23 years agoVG_(maybe_add_context): also stop collecting errors when the total
Julian Seward [Wed, 24 Apr 2002 21:03:47 +0000 (21:03 +0000)] 
VG_(maybe_add_context): also stop collecting errors when the total
number (in contrast to the total number of _different_) of them
gets too high.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@139

23 years agoVG_(malloc_aligned): accept req_alignB == 4.
Julian Seward [Wed, 24 Apr 2002 20:32:50 +0000 (20:32 +0000)] 
VG_(malloc_aligned): accept req_alignB == 4.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@138

23 years agoWrappers for open64/lseek64.
Julian Seward [Wed, 24 Apr 2002 20:29:58 +0000 (20:29 +0000)] 
Wrappers for open64/lseek64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@137

23 years agoOnce VG_(maybe_add_context) starts ignoring errors, ignore them
Julian Seward [Wed, 24 Apr 2002 20:20:22 +0000 (20:20 +0000)] 
Once VG_(maybe_add_context) starts ignoring errors, ignore them
right up front, in the VG_(record_*_error) functions.  This is an
attempt to avoid excessive performance problems with programs which
have excessive numbers of errors.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@136

23 years ago- Fast-track pthread_mutex_trylock(), even though programs which use
Julian Seward [Wed, 24 Apr 2002 19:51:31 +0000 (19:51 +0000)] 
- Fast-track pthread_mutex_trylock(), even though programs which use
  it extensively are probably badly designed -- they are polling.

- VG_(deliver_signals): return a Bool indicating if any signals
  really were delivered.  Used only to try and reduce excessive
  frequency of system sanity checks.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@135

23 years agoAdd wait() wrapper.
Julian Seward [Wed, 24 Apr 2002 19:26:47 +0000 (19:26 +0000)] 
Add wait() wrapper.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@134

23 years agoAdd a very simple test for pthread_once().
Julian Seward [Wed, 24 Apr 2002 19:23:50 +0000 (19:23 +0000)] 
Add a very simple test for pthread_once().

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@133

23 years agoAdd a simplistic implementation of pthread_once().
Julian Seward [Wed, 24 Apr 2002 19:21:39 +0000 (19:21 +0000)] 
Add a simplistic implementation of pthread_once().

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@132

23 years agoAllow more slack with VG_STARTUP_STACK_MASK. Also increase some
Julian Seward [Wed, 24 Apr 2002 14:44:23 +0000 (14:44 +0000)] 
Allow more slack with VG_STARTUP_STACK_MASK.  Also increase some
table sizes, for Galeon.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@131

23 years agoAdd wrapper for system().
Julian Seward [Wed, 24 Apr 2002 13:28:15 +0000 (13:28 +0000)] 
Add wrapper for system().

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@130

23 years agoAdd test for stupid malloc etc args.
Julian Seward [Wed, 24 Apr 2002 11:44:27 +0000 (11:44 +0000)] 
Add test for stupid malloc etc args.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@129

23 years agoDetect, print warning, and "correctly" handle implausible requests
Julian Seward [Wed, 24 Apr 2002 11:37:37 +0000 (11:37 +0000)] 
Detect, print warning, and "correctly" handle implausible requests
such as malloc(negative-argument).  You'd be amazed at the stupidity
of some of the programs people run on valgrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@128

23 years ago- Use CFLAGS in demangle/Makefile.am
Julian Seward [Wed, 24 Apr 2002 11:14:22 +0000 (11:14 +0000)] 
- Use CFLAGS in demangle/Makefile.am
- Get rid of -Werror; it breaks to many people's builds.  It can be
  passed in with make variable WERROR if needed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@127

23 years ago--> 20020424.
Julian Seward [Wed, 24 Apr 2002 02:32:30 +0000 (02:32 +0000)] 
--> 20020424.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@126

23 years agoAdd wrapper for sendto().
Julian Seward [Wed, 24 Apr 2002 02:28:34 +0000 (02:28 +0000)] 
Add wrapper for sendto().

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@125

23 years agoAdd __NR_madvise.
Julian Seward [Wed, 24 Apr 2002 02:24:44 +0000 (02:24 +0000)] 
Add __NR_madvise.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@124

23 years agoMore glibc-2.1.X compiler fixes (Lionel Ulmer).
Julian Seward [Wed, 24 Apr 2002 02:20:20 +0000 (02:20 +0000)] 
More glibc-2.1.X compiler fixes (Lionel Ulmer).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@123

23 years agominor tweaks to constants
Julian Seward [Wed, 24 Apr 2002 02:19:36 +0000 (02:19 +0000)] 
minor tweaks to constants

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@122

23 years agoFast-track pthread_mutex_{lock,unlock} in the scheduler. This reduces
Julian Seward [Wed, 24 Apr 2002 01:57:27 +0000 (01:57 +0000)] 
Fast-track pthread_mutex_{lock,unlock} in the scheduler.  This reduces
their cost by about a factor of 20, which fixes the performance probs
observed with Opera.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@121

23 years agoFix total b0rkage of signal handling caused by stupidly giving the
Julian Seward [Wed, 24 Apr 2002 01:17:42 +0000 (01:17 +0000)] 
Fix total b0rkage of signal handling caused by stupidly giving the
same value to VG_USERREQ__READ_MILLISECOND_TIMER and
VG_USERREQ__SIGNAL_RETURNS.  Duh.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@120

23 years agoVarious upgrades, with the effect that mozilla now runs, although
Julian Seward [Tue, 23 Apr 2002 16:52:51 +0000 (16:52 +0000)] 
Various upgrades, with the effect that mozilla now runs, although
it has tremendous performance problems.

* Implement pthread_key_{create,delete} and pthread_{set,get}specific.

* Implement pthread_cond_timedwait.  A nuisance.

* New timer infrastructure, based on the RDTSC instruction.  This
  allows fast, accurate time measurement without swamping the host with
  gettimeofday() syscalls.

There's something definitely screwy about the scheduler, making opera
run slowly and mozilla run unbelievably slowly.  To be investigated.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@119

23 years agoDeal properly with client arguments with spaces in. (Aharon Robbins).
Julian Seward [Mon, 22 Apr 2002 22:26:51 +0000 (22:26 +0000)] 
Deal properly with client arguments with spaces in.  (Aharon Robbins).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@118

23 years agoCompilation fixes for glibc-2.1.X systems. (Lionel Ulmer).
Julian Seward [Mon, 22 Apr 2002 12:45:25 +0000 (12:45 +0000)] 
Compilation fixes for glibc-2.1.X systems.  (Lionel Ulmer).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@117

23 years agoI feel like doing a snapshot today; hence date -> 0422.
Julian Seward [Mon, 22 Apr 2002 12:42:55 +0000 (12:42 +0000)] 
I feel like doing a snapshot today; hence date -> 0422.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@116

23 years agoGDB-attach cleanups. Have our own system() so we don't have to use
Julian Seward [Sun, 21 Apr 2002 22:03:07 +0000 (22:03 +0000)] 
GDB-attach cleanups.  Have our own system() so we don't have to use
glibc's, and tell the user if starting GDB failed for some reason.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@115

23 years ago%@]$*$* Intel and their %@]$*$* stupid braindead assembler mnemonics!
Julian Seward [Sun, 21 Apr 2002 20:26:06 +0000 (20:26 +0000)] 
%@]$*$* Intel and their %@]$*$* stupid braindead assembler mnemonics!

It's not that I'm incompetent.  Honest.

Fix bug causing GDB attach (detach) to crash system on multithreaded
programs.  This bug has been in Valgrind all along.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@114

23 years ago- don't check if the compiler supports const. No compiler we care
Dirk Mueller [Sun, 21 Apr 2002 13:32:28 +0000 (13:32 +0000)] 
- don't check if the compiler supports const. No compiler we care
  about doesn't support it
- readd -Werror
- move setting of CFLAGS to the Makefile instead of the configure
  script, to avoid that the custom flags we use screw up configure checks

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@113

23 years agofix compilation
Dirk Mueller [Sun, 21 Apr 2002 13:25:53 +0000 (13:25 +0000)] 
fix compilation

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@112

23 years agoMake the GDB-attach stuff thread-aware, and work (at least partially)
Julian Seward [Sun, 21 Apr 2002 13:05:34 +0000 (13:05 +0000)] 
Make the GDB-attach stuff thread-aware, and work (at least partially)
when running multithreaded.  Can still cause crashes (assertion failures)
when GDB exits.  I think it that's due to my use of libc's system()
call; should roll my own.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@111

23 years agoAdd a nonblocking poll() -- same trick as nonblocking select().
Julian Seward [Sun, 21 Apr 2002 12:19:41 +0000 (12:19 +0000)] 
Add a nonblocking poll() -- same trick as nonblocking select().
Add pthread_cond_destroy().

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@110

23 years agoAdd JCond-32 NP (long jump when parity odd) and CMOV NP too.
Julian Seward [Sun, 21 Apr 2002 11:43:11 +0000 (11:43 +0000)] 
Add JCond-32 NP (long jump when parity odd) and CMOV NP too.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@109

23 years agoMinor tweaks to the nonblocking select() implementation.
Julian Seward [Sun, 21 Apr 2002 01:08:26 +0000 (01:08 +0000)] 
Minor tweaks to the nonblocking select() implementation.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@108

23 years agoAdd pthread_mutex_trylock, and add various other hacks to try and make
Julian Seward [Sun, 21 Apr 2002 00:13:57 +0000 (00:13 +0000)] 
Add pthread_mutex_trylock, and add various other hacks to try and make
Mozilla work.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@107

23 years agoAdd comments explaining checks made by scheduler_sanity().
Julian Seward [Sat, 20 Apr 2002 20:53:17 +0000 (20:53 +0000)] 
Add comments explaining checks made by scheduler_sanity().

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@106

23 years agoSigh. Remove -Werror because it causes the ./configure test for working
Julian Seward [Sat, 20 Apr 2002 15:49:34 +0000 (15:49 +0000)] 
Sigh.  Remove -Werror because it causes the ./configure test for working
const qualifier to fail.  This causes config.h to #define const to nothing,
which causes the whole compilation to fail.

What's the right way to fix this?  I really like having -Werror.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@105

23 years agoAdd pthread_condattr_destroy.
Julian Seward [Sat, 20 Apr 2002 13:59:33 +0000 (13:59 +0000)] 
Add pthread_condattr_destroy.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@104

23 years agoSnapshot date -> 20020420.
Julian Seward [Sat, 20 Apr 2002 13:56:38 +0000 (13:56 +0000)] 
Snapshot date -> 20020420.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@103

23 years agoAdd fairly complete, and apparently working, support for condition
Julian Seward [Sat, 20 Apr 2002 13:53:23 +0000 (13:53 +0000)] 
Add fairly complete, and apparently working, support for condition
variables.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@102

23 years agoVG_(record_free_error) / VG_(record_freemismatch_error) are called
Julian Seward [Fri, 19 Apr 2002 15:43:37 +0000 (15:43 +0000)] 
VG_(record_free_error) / VG_(record_freemismatch_error) are called
by the scheduler, not by generated code.  So pass in the relevant
ThreadState*; don't get it from VG_(get_current_tid)().

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@101

23 years agoContinue trying to extract myself from the pthread_mutex_* swamp.
Julian Seward [Fri, 19 Apr 2002 14:40:57 +0000 (14:40 +0000)] 
Continue trying to extract myself from the pthread_mutex_* swamp.

Fall back to a compromise position, which makes my mutex implementation
initialiser- and structure-compatible with LinuxThreads, and ditto the
upcoming condition var implementation.  In particular this means that
((ThreadId)0) is an invalid thread ID, so vg_threads[0] is never used,
and vg_threads[1] specially denotes the "main" thread.

Remove the scheme of having a linked list of threads waiting on
each mutex.  It is too difficult to get the right semantics for
when a signal is delivered to a thread blocked in pthread_mutex_lock().
Instead, use the old scheme of each thread stating with its .waited_on_mx
field, which mutex it is waiting for.  This makes pthread_mutex_unlock()
less efficient, but at least it all works.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@100

23 years agoSimply and rationalise pthread_mutex implementation, in preparation
Julian Seward [Thu, 18 Apr 2002 22:38:41 +0000 (22:38 +0000)] 
Simply and rationalise pthread_mutex implementation, in preparation
for implementation of condition variables.

* Use the native pthread_mutex_t directly; we no longer have our own
  VgMutex type nor a fixed array of them.

* Give ThreadState a new field q_next :: ThreadId, used to make a
  linked list of threads waiting on a mutex, or condition variable.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@99

23 years agoYay! Opera (6.0TP2) now works.
Julian Seward [Thu, 18 Apr 2002 11:37:52 +0000 (11:37 +0000)] 
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

23 years agoCompile flags += -Werror. I'm tired of looking carefully for warnings.
Julian Seward [Thu, 18 Apr 2002 10:03:02 +0000 (10:03 +0000)] 
Compile flags += -Werror.  I'm tired of looking carefully for warnings.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@97

23 years agoOops! The floating-point conditional-move instructions read %EIP, so
Julian Seward [Thu, 18 Apr 2002 02:18:24 +0000 (02:18 +0000)] 
Oops!  The floating-point conditional-move instructions read %EIP, so
we'd better annotate them as such!

Fixes a floating-point misbehaviour bug reported by Robert W. Anderson
<anderson110@poptop.llnl.gov>.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@95

23 years agoSanity check mutex implementation, and add support for recursive mutexes.
Julian Seward [Wed, 17 Apr 2002 23:21:37 +0000 (23:21 +0000)] 
Sanity check mutex implementation, and add support for recursive mutexes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@94

23 years agoGet rid of bogus vg_assert(VG_(bbs_done) < 1000000);
Julian Seward [Wed, 17 Apr 2002 19:40:49 +0000 (19:40 +0000)] 
Get rid of bogus       vg_assert(VG_(bbs_done) < 1000000);
intended to test previous commit.  Duh.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@93

23 years agoShow backtraces for all threads in vg_assert, VG_(panic) and
Julian Seward [Wed, 17 Apr 2002 19:35:12 +0000 (19:35 +0000)] 
Show backtraces for all threads in vg_assert, VG_(panic) and
VG_(unimplemented).  In future this will not be enabled by default due
to the danger of recursion of assertion failures.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@92

23 years agoChange --trace-pthread= flag to accept none|some|all, for finer level
Julian Seward [Tue, 16 Apr 2002 22:50:32 +0000 (22:50 +0000)] 
Change --trace-pthread= flag to accept none|some|all, for finer level
of pthread event tracing.  And allow this info to be passed across to
the client, where vg_libpthread.c uses it to also control verbosity.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@91

23 years agoignore
Dirk Mueller [Tue, 16 Apr 2002 10:53:53 +0000 (10:53 +0000)] 
ignore

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@90

23 years agoAdd more pthread wrappers in a failed attempt to get Opera 6.0TP2
Julian Seward [Tue, 16 Apr 2002 04:40:49 +0000 (04:40 +0000)] 
Add more pthread wrappers in a failed attempt to get Opera 6.0TP2
to run.  Now it creates some threads but segfaults.  Also add
wrapper for syscall __NR_mremap; it is way wrong, but finding
a decent description of what mremap() really does is nearly
impossible.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@89

23 years agoHandle VG_USERREQ__PTHREAD_GET_THREADID and VG_USERREQ__RUNNING_ON_VALGRIND
Julian Seward [Tue, 16 Apr 2002 03:44:31 +0000 (03:44 +0000)] 
Handle VG_USERREQ__PTHREAD_GET_THREADID and VG_USERREQ__RUNNING_ON_VALGRIND
cheaply, with the trivial-client-request mechanism.  The latter is called
once per pthread call, even simple ones like pthread_mutex_[un]lock.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@88

23 years agoGet rid of the muraroa.demon.co.uk references since that account is
Julian Seward [Tue, 16 Apr 2002 02:51:05 +0000 (02:51 +0000)] 
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

23 years agoUpdate the message on clone() failure to reflect new pthreads work.
Julian Seward [Tue, 16 Apr 2002 02:09:31 +0000 (02:09 +0000)] 
Update the message on clone() failure to reflect new pthreads work.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@82

23 years agoMake --demangle=no work as advertised.
Julian Seward [Tue, 16 Apr 2002 02:05:49 +0000 (02:05 +0000)] 
Make --demangle=no work as advertised.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@81

23 years agoDon't refer to IPC_64 if it doesn't exist. Was breaking builds on older
Julian Seward [Tue, 16 Apr 2002 01:58:19 +0000 (01:58 +0000)] 
Don't refer to IPC_64 if it doesn't exist.  Was breaking builds on older
systems.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@80

23 years agoGet rid of the --client-perms= flag. Valgrind now depends critically
Julian Seward [Tue, 16 Apr 2002 01:55:18 +0000 (01:55 +0000)] 
Get rid of the --client-perms= flag.  Valgrind now depends critically
on the client-request subsystem, and disabling it is no longer a
sensible thing to do.

Also: in the manual, mention flags --trace-sched= and --trace-pthread=.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@79

23 years agoDon't skip the top frame when picking up ExeContexts for malloc etc.
Julian Seward [Tue, 16 Apr 2002 01:10:18 +0000 (01:10 +0000)] 
Don't skip the top frame when picking up ExeContexts for malloc etc.
This restores the pre-pthread-merge behaviour.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@78

23 years agoFix -Wall complaints.
Julian Seward [Tue, 16 Apr 2002 00:57:02 +0000 (00:57 +0000)] 
Fix -Wall complaints.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@77

23 years agoRelent, and properly implement bt/bts/btc/btr for literal bit-offsets.
Julian Seward [Tue, 16 Apr 2002 00:42:12 +0000 (00:42 +0000)] 
Relent, and properly implement bt/bts/btc/btr for literal bit-offsets.
bt_literal.c is a somewhat halfhearted test case for it.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@76

23 years agoGet rid of the old bt/bts/btr/btc implementation.
Julian Seward [Mon, 15 Apr 2002 18:36:39 +0000 (18:36 +0000)] 
Get rid of the old bt/bts/btr/btc implementation.

Turns out these insns are also available as Grp8 extensions, with
literal bit-offset values.  Nuisance.  I've #if 0'd out the old code
which implements them since am too lazy to fix them properly, and I
can't find any cases of their use anyway.  I'll wait until someone
yelps.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@75

23 years agoAdd fairly comprehensive test case for bt/bts/btc/btc, mem and reg
Julian Seward [Mon, 15 Apr 2002 16:01:47 +0000 (16:01 +0000)] 
Add fairly comprehensive test case for bt/bts/btc/btc, mem and reg
targets, although size-L (4-byte) only.  In any event the jitter
doesn't handle the size 2 case and has never been asked too, AFAIK.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@74

23 years agoCorrectly implement x86 bt/btc/bts/btr insn. Previous impl was wrong:
Julian Seward [Mon, 15 Apr 2002 14:35:28 +0000 (14:35 +0000)] 
Correctly implement x86 bt/btc/bts/btr insn.  Previous impl was wrong:

* Didn't handle correctly operands in memory, where arbitrary signed
  bit offsets are allowed.  Prior impl will trash the client's stack
  and give the wrong answer.

* Was done by a helper function and therefore could give spurious
  value errors.

Now the address computations are done in-line.

Old implementation is there, but unused and scheduled for demolition.

Test case to follow.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@73