89 Commits

Author SHA1 Message Date
Nicholas Nethercote
a2838e5fe1 In response to bug #85665, clarify what --trace-children=yes does.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2521
2004-07-22 08:57:50 +00:00
Nicholas Nethercote
2fab200ad0 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
2004-06-21 12:42:35 +00:00
Robert Walsh
79b252dfdf Memory pool support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2428
2004-06-19 18:12:36 +00:00
Nicholas Nethercote
63c632f5f3 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
2004-06-16 11:51:08 +00:00
Dirk Mueller
3d5c39f6cf fix up the other places as well
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2314
2004-03-13 02:49:49 +00:00
Nicholas Nethercote
5ec5ade4c2 Killed the terminally wounded --stop-after option.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2238
2004-02-01 17:29:59 +00:00
Nicholas Nethercote
9c13bfd5e5 No longer showing debugging options for --help; only for the newly added
--help-debug.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2237
2004-01-31 22:55:15 +00:00
Nicholas Nethercote
16523cef73 Patch from Tom Hughes:
Patch to allow debuggers other than GDB to be used

    The patch replaces --gdb-attach and --gdb-path with --db-attach and
    --db-command which are more general. The --db-command switch takes a
    command string that can contain one or more instances of %p and %f markers.
    The %p marker is replaced with the PID of the process to attach to and the
    %f marker with the filename of the executable being attached to.

    The default command is "gdb -nw %f %p" which gaves the same result as
    currently.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2232
2004-01-26 16:48:06 +00:00
Nicholas Nethercote
aa5c98c53b Moved stage2.c into vg_main.c. Merged main() and VG_(main)(); VG_(main)()
no longer exists.  One advantage of this is that global
variables/structures needed for communicating between the two can be made
local.  Also, the order in which things happen has been simplified.

This is mostly just a big refactoring.  Startup is now a fair bit easier to
understand.  Dependencies between the various startup stages are fairly well
documented in comments.  Also, --help and --version now work properly --
eg. --help gives tool-specific help if --tool was specified.  There is still
some parts where things could be reordered and/or simplified, and where the
dependencies aren't clear.  These are marked with 'XXX'.

One new feature was added: ability to read options from ~/.valgrindrc and
./.valgrindrc.  Part of this is support for specifying tool-specific options
in the form --toolname:tool-specific-option.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2222
2004-01-24 18:18:54 +00:00
Nicholas Nethercote
1f7c6e9d1f Updated the manual for some recent changes, esp. the fact that Memcheck is no
longer the default.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2216
2004-01-21 13:59:23 +00:00
Jeremy Fitzhardinge
e821cecc7c Small update about unimplemented instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2214
2004-01-21 01:21:29 +00:00
Nicholas Nethercote
ba174de833 Update limitations section: merge some old changes from 2.0.0 branch, and some
new changes that only apply to HEAD.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2208
2004-01-19 22:20:38 +00:00
Ismail Dönmez
eb1ea76873 CVS_SILENT NPTL is Native Posix blah blah
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2112
2003-12-14 17:38:53 +00:00
Dirk Mueller
6b60f29b51 remove reference to --assume-2.4 option
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2066
2003-11-27 11:43:53 +00:00
Nicholas Nethercote
d6d804d382 Updated all "report bugs to..." messages to point to valgrind.kde.org; also
updated the docs to refer to valgrind.kde.org instead of the old website.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2055
2003-11-20 16:20:55 +00:00
Robert Walsh
f9ea43d896 Add a facility for tracking open file descriptors. Information about
still open files is dumped out exit.  Enabled using the --track-fds
switch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2031
2003-11-17 17:45:00 +00:00
Nicholas Nethercote
fb2d543ee8 Started to rescind the name "skin", replacing it with "tool". Did this in all
the places that normal users will see:

  - command line: --tool=foo (although --skin=foo still works)
  - docs: removed all traces (included renaming coregrind_skins.html to
    coregrind_tools.html)
  - in the usage messages
  - in error messages

Also did in in some places that I judged were unlikely to cause clashes with
existing workspaces:

  - in the header comments of many files (eg. "This file is part of Memcheck, a
    Valgrind tool for...")
  - in the regtests script
  - in the .supp files
  - in AUTHORS
  - in README_MISSING_SYSCALL_OR_IOCTL

Also update the AUTHORS file to mention Jeremy.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2027
2003-11-14 17:47:54 +00:00
Nicholas Nethercote
d7bfd760a8 Changed error messages: now don't print anything below main() unless the new
option --show-below-main is on.  It's on by default.  It also affects
suppressions generated with --gen-suppressions=yes.  Updated reg tests
accordingly.

Also updated docs for this.  And added some missing command-line args to docs.
Also compartmentalised the options a little in the docs, and rearranged the
order of options in the usage message, in anticipation of a bigger
rearrangement that will be necessary soon -- to distinguish options used by all
skins from those used by error-checking skins, to skin-specific ones.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2020
2003-11-13 17:35:04 +00:00
Jeremy Fitzhardinge
65649c9d47 Patch from Robert Walsh <rjwalsh@durables.org>. Adds some new client
requests to allow client code to print messages through Valgrind's
logging mechanism.  The new requests are:
  VALGRIND_PRINTF - do a normal printf (prefixed with **PID**)
  VALGRIND_PRINTF_BACKTRACE - do a printf with stack trace
  VALGRIND_INTERNAL_PRINTF - printf, but for internal use (prefixed with ==PID==)
  VALGRIND_INTERNAL_PRINTF_BACKTRACE - as above, with backtrace


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1974
2003-10-31 07:12:21 +00:00
Julian Seward
3cab8f4f8e Mention that -fno-inline is a helpful build flag when you're debugging.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1921
2003-10-14 07:30:33 +00:00
Nicholas Nethercote
4877ebb17e Moved the MALLOCLIKE and FREELIKE client requests out of memcheck.h, and into
valgrind.h.  Although these requests are not implemented by the core, they can
be implemented by skins that track heap blocks, eg. Memcheck, Annelid, Massif.
This is in preparation for committing Massif to the repository.

I think I managed to make the change in a binary-compatible way.  The only
inconvenience for users is that if they have a client program compiled with the
old requests in, Valgrind will abort with an explanatory message that tells
them to recompile.  Once they've done that (no changes to their program are
required), it works again.

I even updated the docs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1881
2003-10-02 13:44:04 +00:00
Nicholas Nethercote
24b34c91c8 Fixed up the client request info in the docs, which required splitting the core
requests from the Memcheck requests and putting the descriptions in the
appropriate parts of the docs.

Removed the __VALGRIND_SOME_SKIN_H test -- it was designed to prevent people
#including valgrind.h when they probably want memcheck.h, but it's actually a
reasonable thing to do to #include valgrind.h alone, because there are some
requests in valgrind.h.

Removed references to VALGRIND_MAKE_NOACCESS_STACK from the docs, as it doesn't
exist in the implementation.

Fixed a few other minor things.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1880
2003-10-02 13:25:02 +00:00
Nicholas Nethercote
aca466757f Changed behaviour of VALGRIND_COUNT_LEAKS slightly. Previously, the numbers it
returned (bytes leaked, dubious, etc) were incremented for every leak check
performed.  So if you called VALGRIND_DO_LEAK_CHECK twice in a row, the totals
would be updated twice by the same amount.  This was a bit silly.  So now
COUNT_LEAKS just returns the numbers of bytes leaked found from the previous
leak check.  I even updated the docs, and changed the regression test so old
version fail but the new version passes (by doing two DO_LEAK_CHECKS in a row).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1778
2003-07-22 22:03:58 +00:00
Julian Seward
f7f560b8e1 Add patch from Sami Liedes <sliedes@cc.hut.fi> making GDB use more flexible:
--gdb-path=/path/to/gdb   allows running some alternate GDB
--input-fd=<n>            allows reading input from some fd other than stdin
I even updated the docs :-)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1754
2003-07-13 10:54:33 +00:00
Dirk Mueller
faf02201e5 spelling fixes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1715
2003-07-04 16:18:15 +00:00
Nicholas Nethercote
5d5fbb5309 Fixed up docs a bit: did the core/skin split properly for suppressions.
Client requests still need to be fixed, though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1647
2003-05-20 18:24:54 +00:00
Nicholas Nethercote
a2c7da2ae8 wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1646
2003-05-20 17:42:26 +00:00
Nicholas Nethercote
c4e8c61d5a Minor docs fixups.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1644
2003-05-20 17:32:21 +00:00
Nicholas Nethercote
40571c6f66 Added VALGRIND_MALLOCLIKE_BLOCK and VALGRIND_FREELIKE_BLOCK which allow you to
use a custom-allocator and detect almost as many errors as you could detect if
you used malloc/new/new[].  (eg. leaks detected, free errors, free mismatch,
etc).

Had to fiddle with mac_malloc_wrappers.c a bit to factor out the appropriate
code to be called from the client request handling code.  Also had to add a
new element `MAC_AllocCustom' to the MAC_AllocKind type.

Also added a little documentation, and a regression test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1643
2003-05-20 16:38:24 +00:00
Nicholas Nethercote
8c22ec62d9 Made memcpy()-et-al-overlap errors fully fledged errors, suppressible,
recordable, etc.  Thanks to Tom Hughes <thh@cyberscience.com> for the patch.

Also fixed a minor bug in the reporting -- the src/dst pointers given for
strncat(), strcpy(), strcat().

And I updated the relevent regression test.

And I even added relevant documentation.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1582
2003-05-02 17:24:29 +00:00
Nicholas Nethercote
1b48c55fc5 Added two client requests: VALGRIND_COUNT_ERRORS and VALGRIND_COUNT_LEAKS.
The first returns the number of errors found so far, and is a core request.
The second returns the number of bytes found
reachable/dubious/leaked/suppressed by all leak checks so far, for Memcheck and
Addrcheck.

Both are useful for using Valgrind in regression test suites where multiple
tests are present in a single file -- one can run Valgrind with no output
(using --logfile-fd=-1) and use the requests after each test to determine if
any errors happened.

Had to rename and make public vg_n_errs_found --> VG_(n_errs_found) to do so.
Nb: leak errors are not counted as errors for the purposes of
VALGRIND_COUNT_ERRORS.  This was decided as the best thing to do after
discussion with Olly Betts, who original suggested these changes.

Pulled out common client request code shared between Memcheck and Addrcheck.

Added a regression test for this.

Added some documentation too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1533
2003-04-21 13:24:40 +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
3cc0c8f8fa Minor HTML fixes in docs, thanks to Arnaud Desitter.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1522
2003-04-08 11:08:45 +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
Julian Seward
504bf9fb88 Document renaming of valgrind.h to memcheck.h.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1498
2003-04-03 22:09:13 +00:00
Nicholas Nethercote
646c7b9b91 Documentation changes only.
Added a couple of links to the "Valgrind skins" doc, because there were none.

Added a section "suggested skins" in the "Valgrind skins" doc, just in case it
inspires anyone in user-land.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1482
2003-03-25 13:38:35 +00:00
Julian Seward
d720203edd Fix up the documentation to be just about OK for version 2.0.
MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1461
2003-03-16 01:12:16 +00:00
Nicholas Nethercote
c273195e12 Minor documentation update about 'details'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1414
2003-02-03 12:21:53 +00:00
Julian Seward
0f6cf30022 Restructure the documentation to try and make it hang together better.
Majorly improved.  Still a lot to do, but the structure is better.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1324
2002-11-18 00:07:28 +00:00
Nicholas Nethercote
7cf2e186e3 Lots of changes to future-proof the core/skin interface, making it less likely
that changes will cause binary incompatibilities.  Mostly done by hiding naked
structs with function calls.

Structs hidden in this way were: UCodeBlock, SkinSupp and SkinError (which were
merged back with CoreSupp and CoreError into single types Supp and Error),
ShadowChunk, VgDetails, VgNeeds and VgTrackEvents.  The last three are the most
important ones, as they are (I think) the most likely to change.

Suitable get()/set() methods were defined for each one.  The way UCodeBlocks
are copied for instrumentation by skins is a little different now, using
setup_UCodeBlock.  Had to add a few other functions here n there.  Changed
how SK_(complete_shadow_chunk) works a bit.

Added a file coregrind/vg_needs.c which contains all the get/set functions.
It's pretty simple.

The changes are not totally ideal -- eg. ShadowChunks has get()/set() methods
for its `next' field which arguably shouldn't be exposed (betraying the fact
that it's a linked list), and the get()/set() methods are a bit cumbersome at
times, esp. for `Error' because the fields are accessed quite a few times, and
the treatment of Supps and Errors is a bit inconsistent (but they are used in
different ways), and sizeof_shadow_blocks is still a hack.  But still better
than naked structs.  And one advantage is that a bit of sanity checking can be
performed by the get()/set() methods, as is done for VG_({get,set}_sc_extra)()
to make sure no reading/writing occurs outside the allowed area.

I didn't do it for UInstr, because its fields are accessed directly in lots and
lots of spots, which would have been a great big pain and I was a little
worried about overhead of calling lots of extra functions, although in practice
translation times are small enough that it probably doesn't matter.

Updated the example skin and the docs, too, hurrah.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1314
2002-11-14 12:42:47 +00:00
Julian Seward
5fd0ef7ca3 Just call me Mr Brain-Dead Moron. Move the documentation sources to
where I _should_ have put them in the first place, and fix up the
Makefile.am's accordingly.  'make' and 'make install' now work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1292
2002-11-13 21:24:57 +00:00
Julian Seward
50040b9ebc Delete all the old documentation ...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1283
2002-11-11 00:11:22 +00:00
Nicholas Nethercote
9c534e3a5f Added a basic core/skin interface versioning system. Each skin must use the
macro VG_DETERMINE_INTERFACE_VERSION exactly once.  If the X.Y core and skin
versions don't have a matching X (indicating binary incompatibility), Valgrind
will abort execution immediately at startup.

I even documented it in the skins guide!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1279
2002-11-08 15:48:16 +00:00
Julian Seward
e6f9adbd38 merge rev 1.35.2.6:
Change the capitalisation of Reuben's Mite.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1237
2002-10-16 19:41:41 +00:00
Nicholas Nethercote
8a33a377c3 Minor update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1233
2002-10-16 08:38:58 +00:00
Julian Seward
b2ec9dae1b Implement, and document, the --run-libc-freeres=no|yes flag.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1186
2002-10-05 14:15:43 +00:00
Nicholas Nethercote
3c7b9b2e03 Changed startup message to give information about skin and core separately.
Added "version" and "copyright_author" fields for skins to supply.

Now startup message looks something like this:

==12698== cachegrind, an I1/D1/L2 cache profiler for x86-linux.
==12698== Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.
==12698== Built with valgrind-HEAD, a program execution monitor.
==12698== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
==12698== Estimated CPU clock rate is 1422 MHz
==12698== For more details, rerun with: -v

The skin can specify a version number, but the skins that will be distributed
with Valgrind don't.

Also changed "x86 GNU/Linux" to the wicked "x86-linux" at Julian's request.

Updated default regression test filter to handle this new startup message.

----

Also moved the skin's name, description, etc., fields out of VG_(needs) into a
new struct VG_(details), since they are logically quite different to the needs.
Did a little code formatting, etc., for this.  Updated skin docs
correspondingly, too.

Also renamed the need `run_libc_freeres' --> `libc_freeres' so it's a noun
phrase rather than a verb phrase.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1172
2002-10-03 14:05:52 +00:00
Julian Seward
a8bd11ee33 Minor mods
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1159
2002-10-02 09:11:34 +00:00
Nicholas Nethercote
ad2f86232e Added some reasonably thorough documentation on how to write skins. Also added
an example skin which is referred to in the documentation, and is designed to
be a template which can be copied.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1122
2002-09-27 10:29:51 +00:00
Nicholas Nethercote
ae9433672d Removed cachegrind docs (now in cachegrind/docs/)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1097
2002-09-23 13:13:45 +00:00