]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
21 years agoAdd some more assertion checking where it was lacking.
Nicholas Nethercote [Sun, 11 Jul 2004 18:11:33 +0000 (18:11 +0000)] 
Add some more assertion checking where it was lacking.

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

21 years agoRemoved some code from VG_(client_alloc)() that could be left to VG_(mmap)().
Nicholas Nethercote [Sun, 11 Jul 2004 18:01:06 +0000 (18:01 +0000)] 
Removed some code from VG_(client_alloc)() that could be left to VG_(mmap)().

Added a comment about stack extension failure.

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

21 years agoRemoved some unnecessary is_kerror() checks.
Nicholas Nethercote [Sat, 10 Jul 2004 18:08:13 +0000 (18:08 +0000)] 
Removed some unnecessary is_kerror() checks.

Fixed nanosleep's formatting.

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

21 years agoAdded assertion checking to a whole bunch of mmap() and munmap() calls. I used
Nicholas Nethercote [Sat, 10 Jul 2004 17:49:17 +0000 (17:49 +0000)] 
Added assertion checking to a whole bunch of mmap() and munmap() calls.  I used
assertions because if these calls fail, it's a bug in Valgrind.

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

21 years agoFormat wibble.
Nicholas Nethercote [Sat, 10 Jul 2004 17:36:52 +0000 (17:36 +0000)] 
Format wibble.

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

21 years agoFormat wibble
Nicholas Nethercote [Sat, 10 Jul 2004 17:30:07 +0000 (17:30 +0000)] 
Format wibble

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

21 years agoWhoops, fix comment.
Nicholas Nethercote [Sat, 10 Jul 2004 17:27:20 +0000 (17:27 +0000)] 
Whoops, fix comment.

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

21 years agoRemove out-of-date comment.
Nicholas Nethercote [Sat, 10 Jul 2004 17:22:27 +0000 (17:22 +0000)] 
Remove out-of-date comment.

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

21 years agoA few changes:
Nicholas Nethercote [Sat, 10 Jul 2004 17:21:14 +0000 (17:21 +0000)] 
A few changes:
- removed an unnecessary VG_(unmap_range)() call in do_brk() -- the
  VG_(munmap)() just before it does it anyway.
- inlined mprotect_segment() and munmap_segment() because it's more concise and
  easier to understand that way.
- a couple of minor formatting changes
- added and cleaned up a couple of comments

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

21 years agoComment changes only.
Nicholas Nethercote [Sat, 10 Jul 2004 16:59:25 +0000 (16:59 +0000)] 
Comment changes only.

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

21 years agoRemove out-of-date comment -- should have been removed when VG_(mmap)() was
Nicholas Nethercote [Sat, 10 Jul 2004 16:57:20 +0000 (16:57 +0000)] 
Remove out-of-date comment -- should have been removed when VG_(mmap)() was
changed to accept the sf_flags argument.

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

21 years agoRemoved the 'place-holder' behaviour of VG_(mmap). Previously, VG_(mmap) would
Nicholas Nethercote [Sat, 10 Jul 2004 16:50:09 +0000 (16:50 +0000)] 
Removed the 'place-holder' behaviour of VG_(mmap).  Previously, VG_(mmap) would
add a segment mapping to the segment skip-list, and then often the caller of
VG_(mmap) would do another one for the same segment, just to change the SF_*
flags.  Now VG_(mmap) gets passed the appropriate SF_* flags so it can do it
directly.   This results in shorter, simpler code, and less work at runtime.

Also, strengthened checking in VG_(mmap), POST(mmap), POST(mmap2) -- now if the
result is not in the right place, it aborts rather than unmapping and
continuing.  This is because if it's not in the right place, something has
gone badly wrong.

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

21 years agoChange allocation failure message which is no longer true thanks to FV.
Nicholas Nethercote [Sat, 10 Jul 2004 16:17:52 +0000 (16:17 +0000)] 
Change allocation failure message which is no longer true thanks to FV.

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

21 years agoMinor Makefile.am fix (doesn't actually change behaviour, because automake's
Nicholas Nethercote [Sat, 10 Jul 2004 16:11:00 +0000 (16:11 +0000)] 
Minor Makefile.am fix (doesn't actually change behaviour, because automake's
default rules meant 'execve' was being built anyway... but the fix at least
avoids confusion).

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

21 years agoDon't force tool redzones to be multiples of 8.
Nicholas Nethercote [Sat, 10 Jul 2004 16:01:52 +0000 (16:01 +0000)] 
Don't force tool redzones to be multiples of 8.

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

21 years agoFix for bug #78048.
Nicholas Nethercote [Sat, 10 Jul 2004 14:56:28 +0000 (14:56 +0000)] 
Fix for bug #78048.

Problem was that the malloc-replacing tools (memcheck, addrcheck, massif,
helgrind) would assert if a too-big malloc was attempted.  Now they return 0 to
the client.  I also cleaned up the code handling heap-block-metadata in Massif
and Addrcheck/Memcheck a little.

This exposed a nasty bug in VG_(client_alloc)() which wasn't checking if
find_map_space() was succeeding before attempting an mmap().  Before I added
the check, very big mallocs (eg 2GB) for Addrcheck were overwriting the client
space at address 0 and causing crashes.

Added a regtest to all the affected skins for this.

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

21 years agoFixed --sloppy-malloc and --trace-malloc, debugging options that I broke a
Nicholas Nethercote [Sat, 10 Jul 2004 13:56:19 +0000 (13:56 +0000)] 
Fixed --sloppy-malloc and --trace-malloc, debugging options that I broke a
while back (sorry).

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

21 years agoOnly print a warning about not having identified the cache if we have
Tom Hughes [Wed, 7 Jul 2004 07:16:14 +0000 (07:16 +0000)] 
Only print a warning about not having identified the cache if we have
actually failed to recognise it...

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

21 years agominor
Nicholas Nethercote [Tue, 6 Jul 2004 22:46:41 +0000 (22:46 +0000)] 
minor

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

21 years agoCompletely overhauled Cachegrind's data structures. With the new
Nicholas Nethercote [Tue, 6 Jul 2004 21:54:20 +0000 (21:54 +0000)] 
Completely overhauled Cachegrind's data structures.  With the new
scheme, there are two main structures:

1. The CC table holds a cost centre (CC) for every distinct source code
   line, as found using debug/symbol info.  It's arranged by files, then
   functions, then lines.

2. The instr-info-table holds certain important pieces of info about
   each instruction -- instr_addr, instr_size, data_size, its line-CC.
   A pointer to the instr's info is passed to the simulation functions,
   which is shorter and quicker than passing the pieces individually.

This is nice and simple.  Previously, there was a single data structure
(the BBCC table) which mingled the two purposes (maintaining CCs and
caching instruction info).  The CC stuff was done at the level of
instructions, and there were different CC types for different kinds of
instructions, and it was pretty yucky.  The two simple data structures
together are much less complex than the original single data structure.

As a result, we have the following general improvements:

- Previously, when code was unloaded all its hit/miss counts were stuck
  in a single "discard" CC, and so that code would not be annotated.  Now
  this code is profiled and annotatable just like all other code.

- Source code size is 27% smaller.  cg_main.c is now 1472 lines, down
  from 2174.  Some (1/3?) of this is from removing the special handling
  of JIFZ and general compaction, but most is from the data structure
  changes.  Happily, a lot of the removed code was nasty.

- Object code size (vgskin_cachegrind.so) is 15% smaller.

- cachegrind.out.pid size is about 90+% smaller(!)  Annotation time is
  accordingly *much* faster.  Doing cost-centres at the level of source
  code lines rather than instructions makes a big difference, since
  there's typically 2--3 instructions per source line.  Even better,
  when debug info is not present, entire functions (and even files) get
  collapsed into a single "???" CC.  (This behaviour is no different
  to what happened before, it's just the collapsing used to occur in the
  annotation script, rather than within Cachegrind.)  This is a huge win
  for stripped libraries.

- Memory consumption is about 10--20% less, due to fewer CCs.

- Speed is not much changed -- the changes were not in the intensive
  parts, so the only likely change is a cache improvement due to using
  less memory.  SPEC experiments go -3 -- 10% faster, with the "average"
  being unchanged or perhaps a tiny bit faster.

I've tested it reasonably thoroughly, it seems extremely similar result
as the old version, which is highly encouraging.  (The results aren't
quite the same, because they are so sensitive to memory layout;  even
tiny changes to Cachegrind affect the results slightly.)

Some particularly nice changes that happened:

- No longer need an instrumentation prepass;  this is because CCs are not
  stored grouped by BB, and they're all the same size now.  (This makes
  various bits of code much simpler than before).

- The actions to take when a BB translation is discarded (due to the
  translation table getting full) are much easier -- just chuck all the
  instr-info nodes for the BB, without touching the CCs.

- Dumping the cachegrind.out.pid file at the end is much simpler, just
  because the CC data structure is much neater.

Some other, specific changes:

- Removed the JIFZ special handling, which never did what it was
  intended to do and just complicated things.  This changes the results
  for REP-prefixed instructions very slightly, but it's not important.

- Abbreviated the FP/MMX/SSE crap by being slightly laxer with size
  checking -- not an issue, since this checking was just a pale
  imitation of the stricter checking done in codegen anyway.

- Removed "fi" and "fe" handling from cg_annotate, no longer needed due
  to neatening of the CC-table.

- Factorised out some code a bit, so fewer monolithic slabs,
  particularly in SK_(instrument)().

- Just improved formatting and compacted code in general in various
  places.

- Removed the long-commented-out sanity checking code at the bottom.

Phew.

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

21 years agoRemove unused variable.
Nicholas Nethercote [Sat, 3 Jul 2004 20:27:39 +0000 (20:27 +0000)] 
Remove unused variable.

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

21 years agoFix meaningless typo.
Nicholas Nethercote [Fri, 2 Jul 2004 15:28:34 +0000 (15:28 +0000)] 
Fix meaningless typo.

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

21 years agoClarify that you can also iterate from the result of a SkipList_Find.
Jeremy Fitzhardinge [Fri, 2 Jul 2004 00:22:36 +0000 (00:22 +0000)] 
Clarify that you can also iterate from the result of a SkipList_Find.
(Comment change only)

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

21 years agoCouple of clarifying comments about skip lists. (Comment change only)
Nicholas Nethercote [Thu, 1 Jul 2004 12:21:03 +0000 (12:21 +0000)] 
Couple of clarifying comments about skip lists. (Comment change only)

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

21 years agoFix confusing and wrong comment in definition of live ranges in
Julian Seward [Thu, 1 Jul 2004 11:38:36 +0000 (11:38 +0000)] 
Fix confusing and wrong comment in definition of live ranges in
reg-alloc.  (Comment change only).

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

21 years agoFixed variable name mixup, removed no-longer-used VG_STACK_SIZE_W.
Nicholas Nethercote [Wed, 30 Jun 2004 17:34:30 +0000 (17:34 +0000)] 
Fixed variable name mixup, removed no-longer-used VG_STACK_SIZE_W.

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

21 years agoAdd some comments describing the various kinds of magic going on in the
Jeremy Fitzhardinge [Wed, 30 Jun 2004 01:27:06 +0000 (01:27 +0000)] 
Add some comments describing the various kinds of magic going on in the
skiplist implementation.  Also, fix a bug which allocated way too much memory
for the list head (found by Nick).

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

21 years agoMake VPATH builds work so that valgrind can be built in a different
Tom Hughes [Tue, 29 Jun 2004 09:45:37 +0000 (09:45 +0000)] 
Make VPATH builds work so that valgrind can be built in a different
directory from the source tree. This resolves bug 83040.

Based on patch from Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.

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

21 years agoRemove the .in_place directory on a make distclean.
Tom Hughes [Mon, 28 Jun 2004 21:52:40 +0000 (21:52 +0000)] 
Remove the .in_place directory on a make distclean.

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

21 years agoFixed typo in makefile.
Tom Hughes [Mon, 28 Jun 2004 21:37:58 +0000 (21:37 +0000)] 
Fixed typo in makefile.

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

21 years agoBumped the core interface major version number to reflect changes
Tom Hughes [Sun, 27 Jun 2004 18:10:21 +0000 (18:10 +0000)] 
Bumped the core interface major version number to reflect changes
made to the interface when removing nested functions.

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

21 years agoRemoved all uses of nested functions as they only work with gcc and
Tom Hughes [Sun, 27 Jun 2004 17:37:21 +0000 (17:37 +0000)] 
Removed all uses of nested functions as they only work with gcc and
cause the stack to be marked as executable in order for them to work.

All assembler files have also had a declaration added so that the
object they generate will be marked as not needing an executable stack.

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

21 years agoRemoved duplicate call to rw_remap.
Tom Hughes [Sun, 27 Jun 2004 13:26:44 +0000 (13:26 +0000)] 
Removed duplicate call to rw_remap.

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

21 years agoCommit the patch from bug 69508 that seeks to make more of the pthread
Tom Hughes [Sun, 27 Jun 2004 12:48:53 +0000 (12:48 +0000)] 
Commit the patch from bug 69508 that seeks to make more of the pthread
stack attribute related functions work properly as it seems to be a
sensible thing to improve even if it isn't enough to get the JVM running
under valgrind now.

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

21 years agotypo
Nicholas Nethercote [Sun, 27 Jun 2004 12:38:17 +0000 (12:38 +0000)] 
typo

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

21 years agoPrinting slightly more informative message when mmap fails.
Nicholas Nethercote [Sun, 27 Jun 2004 12:30:15 +0000 (12:30 +0000)] 
Printing slightly more informative message when mmap fails.

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

21 years agoChanged (client-heap-size : client-map-seg-size) ratio from 3:1 to 1:2.
Nicholas Nethercote [Sun, 27 Jun 2004 12:29:56 +0000 (12:29 +0000)] 
Changed (client-heap-size : client-map-seg-size) ratio from 3:1 to 1:2.
As a result, can now mmap much more memory (eg. for Memcheck, 850MB up from
250MB, for Nulgrind 1750MB up from 700MB).  The heap is smaller, but that
doesn't matter much, since programs use brk() directly only rarely, and
malloc() falls back on mmap() if brk() fails anyway.

Also changed the debug info printing for memory layout slightly.

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

21 years agoImplement an emulated soft limit for file descriptors in addition to
Tom Hughes [Sat, 26 Jun 2004 11:27:52 +0000 (11:27 +0000)] 
Implement an emulated soft limit for file descriptors in addition to
the current reserved area, which effectively acts as a hard limit. The
setrlimit system call now simply updates the emulated limits as best
as possible - the hard limit is not allowed to move at all and just
returns EPERM if you try and change it.

This should stop reductions in the soft limit causing assertions when
valgrind tries to allocate descriptors from the reserved area.

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

21 years agoIgnore all addrcheck test output files.
Tom Hughes [Fri, 25 Jun 2004 23:25:10 +0000 (23:25 +0000)] 
Ignore all addrcheck test output files.

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

21 years agoReduce rounding size for gap between shadow memory and Valgrind's space from
Nicholas Nethercote [Wed, 23 Jun 2004 16:15:06 +0000 (16:15 +0000)] 
Reduce rounding size for gap between shadow memory and Valgrind's space from
64MB to 1MB.  Gives tools a bit more address space to play with.

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

21 years agoRemove unused #define
Nicholas Nethercote [Tue, 22 Jun 2004 14:20:20 +0000 (14:20 +0000)] 
Remove unused #define

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

21 years agoConvert VG_(exitcode), a global variable, into a local variable.
Nicholas Nethercote [Tue, 22 Jun 2004 14:18:42 +0000 (14:18 +0000)] 
Convert VG_(exitcode), a global variable, into a local variable.

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

21 years agoRemove a function and global variable no longer needed.
Nicholas Nethercote [Tue, 22 Jun 2004 14:09:52 +0000 (14:09 +0000)] 
Remove a function and global variable no longer needed.

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

21 years agoUpdate .cvsignore files
Nicholas Nethercote [Tue, 22 Jun 2004 14:01:40 +0000 (14:01 +0000)] 
Update .cvsignore files

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

21 years agoSlightly disentangle main().
Nicholas Nethercote [Tue, 22 Jun 2004 14:00:09 +0000 (14:00 +0000)] 
Slightly disentangle main().

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

21 years agoRemove two no-longer-used global vars.
Nicholas Nethercote [Tue, 22 Jun 2004 13:19:21 +0000 (13:19 +0000)] 
Remove two no-longer-used global vars.

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

21 years agoPrevent applications from blocking SIGVGINT in the proxy threads.
Tom Hughes [Tue, 22 Jun 2004 08:43:29 +0000 (08:43 +0000)] 
Prevent applications from blocking SIGVGINT in the proxy threads.

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

21 years agoStreamlined --help message a bit.
Nicholas Nethercote [Mon, 21 Jun 2004 13:27:11 +0000 (13:27 +0000)] 
Streamlined --help message a bit.

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

21 years agoRenamed the following options:
Nicholas Nethercote [Mon, 21 Jun 2004 12:42:35 +0000 (12:42 +0000)] 
Renamed the following options:

  --logfile-fd  -->  --log-fd
  --logfile     -->  --log-file
  --logsocket   -->  --log-socket

to be consistent with each other and other options (esp. --input-fd).  Also
renamed some related variables.  The old names still work, for backwards
compatibility, but they're not documented.

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

21 years agoMemory pool support.
Robert Walsh [Sat, 19 Jun 2004 18:12:36 +0000 (18:12 +0000)] 
Memory pool support.

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

21 years agoDon't try and validate the contents of the environment passed to
Tom Hughes [Sat, 19 Jun 2004 13:02:34 +0000 (13:02 +0000)] 
Don't try and validate the contents of the environment passed to
the execve system call if the envp pointer is null as it causes
valgrind to die with a segmentation fault.

CCMAIL: 83573-done@bugs.kde.org

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

21 years agoAdd support for the FIGETBSZ and FIBMAP ioctls based on a patch
Tom Hughes [Sat, 19 Jun 2004 12:41:05 +0000 (12:41 +0000)] 
Add support for the FIGETBSZ and FIBMAP ioctls based on a patch
from Joseph D Wagner <theman@josephdwagner.info>.

CCMAIL: 83025-done@bugs.kde.org

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

21 years agoAdd support for the HDIO_GET_IDENTITY ioctl based on patch
Tom Hughes [Sat, 19 Jun 2004 12:12:01 +0000 (12:12 +0000)] 
Add support for the HDIO_GET_IDENTITY ioctl based on patch
from Jim McDonald <jim@mcdee.net>.

CCMAIL: 83340-done@bugs.kde.org

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

21 years agoAdd support for SIOCGMIIPHY, SIOCGMIIREG and SIOCSMIIREG ioctls and
Tom Hughes [Thu, 17 Jun 2004 23:04:58 +0000 (23:04 +0000)] 
Add support for SIOCGMIIPHY, SIOCGMIIREG and SIOCSMIIREG ioctls and
improve the checking of other interface related ioctls.

Based in part on a patch from Jim McDonald <jim@mcdee.net> supplied
as a fix for bug #83344.

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

21 years agomake "make dist" work.
Oswald Buddenhagen [Thu, 17 Jun 2004 13:25:47 +0000 (13:25 +0000)] 
make "make dist" work.

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

21 years agoIntroduced 4 macros to minimise boilerplate command line processing code.
Nicholas Nethercote [Wed, 16 Jun 2004 21:26:32 +0000 (21:26 +0000)] 
Introduced 4 macros to minimise boilerplate command line processing code.
Nicely cuts around 130 lines of code, spread over the core and several tools.

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

21 years agoAdded VG_(cpuid) to replace the various bits of inline assembler used
Tom Hughes [Wed, 16 Jun 2004 20:51:45 +0000 (20:51 +0000)] 
Added VG_(cpuid) to replace the various bits of inline assembler used
to query the CPU characteristics as the use of four implicit registers
causes havoc when GCC tries to inline and optimise the assembler.

Fix to bug #79696.

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

21 years agoReinstate -h option, which disappeared at some point.
Nicholas Nethercote [Wed, 16 Jun 2004 11:56:29 +0000 (11:56 +0000)] 
Reinstate -h option, which disappeared at some point.

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

21 years agoRemoved documentation references to the 'ioctl-VTIME' and 'truncate-writes'
Nicholas Nethercote [Wed, 16 Jun 2004 11:51:08 +0000 (11:51 +0000)] 
Removed documentation references to the 'ioctl-VTIME' and 'truncate-writes'
weird hacks, which no longer exist thanks to the proxy lwp stuff.

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

21 years agoFixed up various command line option scenarios:
Nicholas Nethercote [Tue, 15 Jun 2004 10:54:40 +0000 (10:54 +0000)] 
Fixed up various command line option scenarios:
  - If no tool is specified, V now gives a short message and a list of
    available tools.  This was meant to happen previously, but a bug prevented
    it from working properly;  it gave the usage message instead.

  - If a bad option is given, V now gives a short message rather than the full
    --help.  This make V consistent with all other programs I looked at.

  - Now returning 0 when you do 'valgrind --help' and 'valgrind --version'
    as other programs do.

  - Removed VG_(startup_logging)() and VG_(shutdown_logging)() as they were
    empty and have been for a long time (always?).

  - Added various tests for these scenarios.  Had to change the regtest
    script slightly to allow for malformed command lines.

This addresses bug (wishlist) #82999.

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

21 years agoCater for systems lacking AT_SYSINFO.
Nicholas Nethercote [Tue, 15 Jun 2004 08:34:10 +0000 (08:34 +0000)] 
Cater for systems lacking AT_SYSINFO.

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

21 years agoDon't bother trying to test semtimedop if it isn't available.
Tom Hughes [Mon, 14 Jun 2004 17:27:41 +0000 (17:27 +0000)] 
Don't bother trying to test semtimedop if it isn't available.

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

21 years agoInclude config.h so that the test for semtimedop works.
Tom Hughes [Mon, 14 Jun 2004 13:15:40 +0000 (13:15 +0000)] 
Include config.h so that the test for semtimedop works.

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

21 years agoFixed the sem test to work on systems with semtimedop.
Tom Hughes [Mon, 14 Jun 2004 12:33:43 +0000 (12:33 +0000)] 
Fixed the sem test to work on systems with semtimedop.

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

21 years agoUnbreak compilation due to missing #define.
Nicholas Nethercote [Mon, 14 Jun 2004 11:56:59 +0000 (11:56 +0000)] 
Unbreak compilation due to missing #define.

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

21 years agoFix problem with FC2's vdso (sysinfo) page, which lives at a low,
Jeremy Fitzhardinge [Mon, 14 Jun 2004 02:36:09 +0000 (02:36 +0000)] 
Fix problem with FC2's vdso (sysinfo) page, which lives at a low,
random address.  This gets unmapped as part of the client setup, and
causes syscalls to fail as a result.  This patch simply disregards the
sysinfo page.  It seems like a blunt fix, but I don't think anything
depends on a sysinfo page.

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

21 years agoFixed cast to work on NPTL systems.
Tom Hughes [Sun, 13 Jun 2004 14:35:43 +0000 (14:35 +0000)] 
Fixed cast to work on NPTL systems.

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

21 years agoAdd support for the semtimedop system call.
Tom Hughes [Sun, 13 Jun 2004 14:23:00 +0000 (14:23 +0000)] 
Add support for the semtimedop system call.

Based on patch from Peter Knaggs <sedragdnuon@yahoo.com>.

CCMAIL: 79714-done@bugs.kde.org

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

21 years agoWhen cancelling a thread that is waiting on a condition variable we
Tom Hughes [Sun, 13 Jun 2004 12:07:53 +0000 (12:07 +0000)] 
When cancelling a thread that is waiting on a condition variable we
need to relock the associated mutex before running the cancellation
handlers.

This patch ensures that the mutex is reaquired in the above case and
also makes pthread_join and pthread_cond_wait act as cancellation points
as required by the POSIX threads standard.

Based on patch from Joseph Link <joelink@joelink.net>.

CCMAIL: 81297-done@bugs.kde.org

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

21 years agoAdd support for separate debug files, which are just separate ELF files
Tom Hughes [Sun, 13 Jun 2004 09:59:02 +0000 (09:59 +0000)] 
Add support for separate debug files, which are just separate ELF files
containing the relevant debug sections and located using the information
in the .gnu_debuglink section of the main file along with some search
rules and checksum logic borrowed from binutils/gdb.

CCMAIL: 82872-done@bugs.kde.org

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

21 years agoAdd a strrchr implementation.
Tom Hughes [Sun, 13 Jun 2004 09:55:22 +0000 (09:55 +0000)] 
Add a strrchr implementation.

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

21 years agoFixed the NPTL cleanup handler support to try and make sure it will
Tom Hughes [Sat, 12 Jun 2004 17:25:25 +0000 (17:25 +0000)] 
Fixed the NPTL cleanup handler support to try and make sure it will
compile on systems with NPTL header files.

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

21 years agoIt appears that NPTL uses a new system for dealing with cleanup
Tom Hughes [Sat, 12 Jun 2004 12:58:22 +0000 (12:58 +0000)] 
It appears that NPTL uses a new system for dealing with cleanup
handlers when a thread is cancelled which has the side effect that
programs linked with librt fail on Fedora Core 2 due to librt having
been built against the NPTL header instead of the old pthread headers.

This change extends valgrind's libpthread.so to handle both the old
and new style cleanup handlers in a similar way to NPTL and seems to
be sufficient to get programs linked with librt working again.

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

21 years agoThere is no __accept in any libc or libpthread that I can find so
Tom Hughes [Fri, 4 Jun 2004 21:42:18 +0000 (21:42 +0000)] 
There is no __accept in any libc or libpthread that I can find so
it isn't clear why we were intercepting that and only aliasing accept
to it. Switched to intercepting accept directly instead.

CCMAIL: 76869-done@bugs.kde.org

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

21 years agoAdd an extra suppression for Fedora Core 2/glibc 2.3.3 systems.
Tom Hughes [Thu, 3 Jun 2004 18:42:34 +0000 (18:42 +0000)] 
Add an extra suppression for Fedora Core 2/glibc 2.3.3 systems.

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

21 years agoChanged cancellation wrappers to use dlsym(RTLD_NEXT) to look up the
Tom Hughes [Thu, 3 Jun 2004 18:00:58 +0000 (18:00 +0000)] 
Changed cancellation wrappers to use dlsym(RTLD_NEXT) to look up the
libc version of the wrapped function when forwarding the call rather
than trying to call the internal __libc_xxx version of the routine
as many of those are marked as GLIBC_PRIVATE in recent releases.

CCMAIL: 82026-done@bugs.kde.org

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

21 years agoOops - fix up broken assert.
Jeremy Fitzhardinge [Thu, 3 Jun 2004 17:12:07 +0000 (17:12 +0000)] 
Oops - fix up broken assert.

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

21 years agoPartial fix for bug 76869. This fixes the problem with returning from
Jeremy Fitzhardinge [Thu, 3 Jun 2004 10:00:42 +0000 (10:00 +0000)] 
Partial fix for bug 76869.  This fixes the problem with returning from
a signal handler when VDSOs are turned off in FC2.  Note that we don't
(yet) support VDSOs being on (use "echo 0 > /proc/sys/kernel/vdso").

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

21 years agoFix wishlist item 82098, thanks to Ralf Wildenhues:
Nicholas Nethercote [Wed, 2 Jun 2004 20:43:24 +0000 (20:43 +0000)] 
Fix wishlist item 82098, thanks to Ralf Wildenhues:

  ANSIfication of the hp2ps code. The most important changes are the correct
  use of the stdarg mechanism (former hacks could bite on other systems, so
  please tell upstream), inclusion of stdlib.h instead of declaring free
  yourself, adding a few missed PROTO()s and using size_t for xmalloc and
  xrealloc.:

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

21 years agoAdded "repne movs", not official but seems to occur. Also restructured the
Nicholas Nethercote [Wed, 2 Jun 2004 14:48:16 +0000 (14:48 +0000)] 
Added "repne movs", not official but seems to occur.  Also restructured the
rep/repe/repne cases to use a switch instead of if/else, as it's cleaner.

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

21 years agoFix patch from this morning -- missing commas, erk
Nicholas Nethercote [Tue, 11 May 2004 16:37:17 +0000 (16:37 +0000)] 
Fix patch from this morning -- missing commas, erk

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

21 years agoTeach Massif about the 'nothrow' versions of new and new[].
Nicholas Nethercote [Tue, 11 May 2004 09:21:08 +0000 (09:21 +0000)] 
Teach Massif about the 'nothrow' versions of new and new[].

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

21 years agoUpdate copyright
Nicholas Nethercote [Tue, 11 May 2004 09:17:49 +0000 (09:17 +0000)] 
Update copyright

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

21 years agoFix for bug #80942.
Nicholas Nethercote [Wed, 5 May 2004 10:46:22 +0000 (10:46 +0000)] 
Fix for bug #80942.

Addrcheck wasn't doing overlap checking as it should.  This is because
mac_replace_strmem.o was being linked with vgskin_addrcheck.so instead of
vgpreload_addrcheck.so.  I fixed the Makefile, and also moved
_VG_USERREQ__MEMCHECK_GET_RECORD_OVERLAP so Addrcheck could see it.  And I
added the 'overlap' test (from memcheck/tests/) to Addrcheck's regression
suite.

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

21 years agoFix comment
Nicholas Nethercote [Tue, 4 May 2004 11:25:34 +0000 (11:25 +0000)] 
Fix comment

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

21 years agoSuppressions for Fedora Core 2.
Robert Walsh [Thu, 29 Apr 2004 08:50:44 +0000 (08:50 +0000)] 
Suppressions for Fedora Core 2.

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

21 years agoImplement syscall 258, for those of use running Fedora Core 2.
Robert Walsh [Thu, 29 Apr 2004 08:40:50 +0000 (08:40 +0000)] 
Implement syscall 258, for those of use running Fedora Core 2.

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

21 years agoFix for bug 79355: fix up bogus assertion that was failing when
Nicholas Nethercote [Tue, 27 Apr 2004 09:51:51 +0000 (09:51 +0000)] 
Fix for bug 79355:  fix up bogus assertion that was failing when
stack_snapshot() returned 0xffffffff as one of its eip values.

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

21 years agoAdd missing SSE case for Memcheck's instrumentation (sigh).
Nicholas Nethercote [Mon, 26 Apr 2004 13:06:16 +0000 (13:06 +0000)] 
Add missing SSE case for Memcheck's instrumentation (sigh).

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

21 years agoTighten MOV's sanity checking slightly
Nicholas Nethercote [Mon, 26 Apr 2004 09:21:25 +0000 (09:21 +0000)] 
Tighten MOV's sanity checking slightly

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

21 years agoSplit some combined error messages, so they are more informative. Also return
Nicholas Nethercote [Mon, 26 Apr 2004 08:05:24 +0000 (08:05 +0000)] 
Split some combined error messages, so they are more informative.  Also return
EPERM where appropriate, instead of EINVAL.

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

21 years agoFix supps for Valgrind's own libpthread leak.
Nicholas Nethercote [Sun, 25 Apr 2004 12:02:31 +0000 (12:02 +0000)] 
Fix supps for Valgrind's own libpthread leak.

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

21 years agoFix bug in helper_{IN,OUT} -- they weren't preserving %eflags as they should.
Nicholas Nethercote [Thu, 22 Apr 2004 18:47:07 +0000 (18:47 +0000)] 
Fix bug in helper_{IN,OUT} -- they weren't preserving %eflags as they should.

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

21 years agoCope with AT_xCACHEBSIZE not being defined, which they aren't on systems
Tom Hughes [Thu, 22 Apr 2004 18:12:31 +0000 (18:12 +0000)] 
Cope with AT_xCACHEBSIZE not being defined, which they aren't on systems
with 2.2 kernels and, it seems, on some systems with 2.4 kernels.

CCMAIL: 79179-done@bugs.kde.org

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

21 years agoSETV and TESTV never have an ArchReg as their first argument.
Nicholas Nethercote [Thu, 22 Apr 2004 12:58:05 +0000 (12:58 +0000)] 
SETV and TESTV never have an ArchReg as their first argument.

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

21 years agoMake support for the FBIOGET ioctls conditional on linux/fb.h being
Tom Hughes [Thu, 22 Apr 2004 07:28:43 +0000 (07:28 +0000)] 
Make support for the FBIOGET ioctls conditional on linux/fb.h being
present at compile time.

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

21 years agoAdd support for the FBIOGET_VSCREENINFO and FBIOGET_FSCREENINFO ioctls
Tom Hughes [Wed, 21 Apr 2004 15:52:33 +0000 (15:52 +0000)] 
Add support for the FBIOGET_VSCREENINFO and FBIOGET_FSCREENINFO ioctls
based on a patch from Paul Olav Tvete <paul@trolltech.com>.

CCMAIL: 77022-done@bugs.kde.org

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

21 years agoChange the debugger attachment code to send the STOP signal to the
Tom Hughes [Wed, 21 Apr 2004 15:39:57 +0000 (15:39 +0000)] 
Change the debugger attachment code to send the STOP signal to the
forked process before using ptrace() to continue it, instead of asking
ptrace to deliver it, as that doesn't seem to work on some versions
of linux.

CCMAIL: 77824-done@bugs.kde.org

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

21 years agoInitialise %cs, %ds and %ss in the virtual machine to match the values
Tom Hughes [Wed, 21 Apr 2004 15:16:43 +0000 (15:16 +0000)] 
Initialise %cs, %ds and %ss in the virtual machine to match the values
supplied by the operating system for the code, data and stack segments.

Explicit references using these segments still won't work but they
will at least produce an assertion to indicate that they aren't
supported instead of raising a segmentation fault in the target
program because of an apparent privilege violation.

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

21 years agofix typo
Nicholas Nethercote [Wed, 21 Apr 2004 09:17:19 +0000 (09:17 +0000)] 
fix typo

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