]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Updated docs with all the changes that I'm aware of that happened since
authorNicholas Nethercote <njn@valgrind.org>
Wed, 1 Dec 2004 00:02:36 +0000 (00:02 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 1 Dec 2004 00:02:36 +0000 (00:02 +0000)
Donna converted them to XML.

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

AUTHORS
cachegrind/docs/cg-tech-docs.xml
docs/xml/manual-core.xml
docs/xml/writing-tools.xml
memcheck/docs/mc-manual.xml
memcheck/docs/mc-tech-docs.xml

diff --git a/AUTHORS b/AUTHORS
index 725f4620b29aa5dcd788d0a57d86de1f11e6ecb0..6b7100b6653a23985fd068941269bfb33a5c112a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,22 +1,21 @@
 
-Julian Seward, jseward@acm.org, was the original author, creating the
+Julian Seward was the original author, creating the
 dynamic translation framework, memcheck stuff, and the
 signal/syscall/threads support gunk.
 
-Nicholas Nethercote, njn25@cam.ac.uk, did the core/tool
-generalisation, and wrote Cachegrind and some of the other tools, and
-tons of other stuff, including code generation improvments.
+Nicholas Nethercote did the core/tool generalisation, and wrote
+Cachegrind and some of the other tools, and tons of other stuff.
 
-Jeremy Fitzhardinge, jeremy@goop.org, wrote Helgrind, and lots of
-syscall/signal simulation stuff, including a complete redesign of how
-syscalls and signals are handled.  Also code generation improvements.
+Jeremy Fitzhardinge wrote Helgrind, and lots of syscall/signal
+simulation stuff, including a complete redesign of how syscalls and
+signals are handled.  Also code generation improvements.
 
-Tom Hughes, thh@cyberscience.com, did a vast number of bug fixes, and
-helped out with support for more recent Linux/glibc versions.
+Tom Hughes did a vast number of bug fixes, and helped out with support
+for more recent Linux/glibc versions.
 
-Robert Walsh, rjwalsh@durables.org, added file descriptor leakage
-checking, new library interception machinery, support for client
-allocation pools, and minor other tweakage.
+Robert Walsh added file descriptor leakage checking, new library
+interception machinery, support for client allocation pools, and minor
+other tweakage.
 
 readelf's dwarf2 source line reader, written by Nick Clifton, was
 modified to be used in Valgrind by Daniel Berlin.
index 210dee0768ed31a997d9f11e173fd1c5b62feab9..bc49a7ae9a08097b077f753e95ef756fe0100c1a 100644 (file)
@@ -9,6 +9,9 @@
 <sect1 id="cg-tech-docs.profiling" xreflabel="Cache profiling">
 <title>Cache profiling</title>
 
+<para>[Note: this document is now very old, and a lot of its contents are out
+of date, and misleading.]</para>
+
 <para>Valgrind is a very nice platform for doing cache profiling
 and other kinds of simulation, because it converts horrible x86
 instructions into nice clean RISC-like UCode.  For example, for
index 6ed8eead9be752bbba9891a61795c15966a7bf2f..06da30a975f889281a1b2f123380d9ae8c2a7f44 100644 (file)
@@ -336,7 +336,7 @@ in total have been seen.  In this situation you might as well
 stop your program and fix it, because Valgrind won't tell you
 anything else useful after this.  Note that the 300/30000 limits
 apply after suppressed errors are removed.  These limits are
-defined in <filename>vg_include.h</filename> and can be increased
+defined in <filename>core.h</filename> and can be increased
 if necessary.</para>
 
 <para>To avoid this cutoff you can use the
index b8b8aff1dd740d474ada594933326558305a9e85..aaf1d9b2b4c9d6ba9648a2e3e2249c403d49db5f 100644 (file)
@@ -291,7 +291,7 @@ object <computeroutput>valgrind.so</computeroutput>, using the
 dynamic linker's <computeroutput>LD_PRELOAD</computeroutput>
 variable.  Any functions defined in the tool that share the name
 with a function defined in core (such as the instrumentation
-function <computeroutput>SK_(instrument)()</computeroutput>)
+function <computeroutput>TL_(instrument)()</computeroutput>)
 override the core's definition.  Thus the core can call the
 necessary tool functions.</para>
 
@@ -373,7 +373,7 @@ top-level directory <computeroutput>valgrind/</computeroutput>.</para>
   trying to understand this file, at least a little; you might
   have to do more complicated things with it later on.  In
   particular, the name of the
-  <computeroutput>vgskin_foobar_so_SOURCES</computeroutput>
+  <computeroutput>vgtool_foobar_so_SOURCES</computeroutput>
   variable determines the name of the tool's shared object, which
   determines what name must be passed to the
   <computeroutput>--tool</computeroutput> option to use the
@@ -384,7 +384,7 @@ top-level directory <computeroutput>valgrind/</computeroutput>.</para>
   <para>Copy <filename>none/nl_main.c</filename> into
   <computeroutput>foobar/</computeroutput>, renaming it as
   <filename>fb_main.c</filename>.  Edit it by changing the lines
-  in <computeroutput>SK_(pre_clo_init)()</computeroutput> to
+  in <computeroutput>TL_(pre_clo_init)()</computeroutput> to
   something appropriate for the tool.  These fields are used in
   the startup message, except for
   <computeroutput>bug_reports_to</computeroutput> which is used
@@ -413,7 +413,7 @@ top-level directory <computeroutput>valgrind/</computeroutput>.</para>
 
    <para>It should automake, configure and compile without
    errors, putting copies of the tool's shared object
-   <computeroutput>vgskin_foobar.so</computeroutput> in
+   <computeroutput>vgtool_foobar.so</computeroutput> in
    <computeroutput>foobar/</computeroutput> and
    <computeroutput>inst/lib/valgrind/</computeroutput>.</para>
   </listitem>
@@ -459,16 +459,16 @@ possible tool, onto the interesting stuff...</para>
 
 <para>A tool must define at least these four functions:</para>
 <programlisting><![CDATA[
-  SK_(pre_clo_init)()
-  SK_(post_clo_init)()
-  SK_(instrument)()
-  SK_(fini)()]]></programlisting>
+  TL_(pre_clo_init)()
+  TL_(post_clo_init)()
+  TL_(instrument)()
+  TL_(fini)()]]></programlisting>
 
 <para>Also, it must use the macro
 <computeroutput>VG_DETERMINE_INTERFACE_VERSION</computeroutput>
 exactly once in its source code.  If it doesn't, you will get a
 link error involving
-<computeroutput>VG_(skin_interface_major_version)</computeroutput>.
+<computeroutput>VG_(tool_interface_major_version)</computeroutput>.
 This macro is used to ensure the core/tool interface used by the
 core and a plugged-in tool are binary compatible.</para>
 
@@ -484,8 +484,8 @@ functions.</para>
 <title>Initialisation</title>
 
 <para>Most of the initialisation should be done in
-<computeroutput>SK_(pre_clo_init)()</computeroutput>.  Only use
-<computeroutput>SK_(post_clo_init)()</computeroutput> if a tool
+<computeroutput>TL_(pre_clo_init)()</computeroutput>.  Only use
+<computeroutput>TL_(post_clo_init)()</computeroutput> if a tool
 provides command line options and must do some initialisation
 after option processing takes place
 (<computeroutput>"clo"</computeroutput> stands for "command line
@@ -497,7 +497,7 @@ using the functions
 compulsory, some aren't.  Some are used when constructing the
 startup message,
 <computeroutput>detail_bug_reports_to</computeroutput> is used if
-<computeroutput>VG_(skin_panic)()</computeroutput> is ever
+<computeroutput>VG_(tool_panic)()</computeroutput> is ever
 called, or a tool assertion fails.  Others have other uses.</para>
 
 <para>Second, various "needs" can be set for a tool, using the
@@ -510,7 +510,7 @@ extra information about malloc'd blocks, etc.</para>
 
 <para>For example, if a tool wants the core's help in recording
 and reporting errors, it must set the
-<computeroutput>skin_errors</computeroutput> need to
+<computeroutput>tool_errors</computeroutput> need to
 <computeroutput>True</computeroutput>, and then provide
 definitions of six functions for comparing errors, printing out
 errors, reading suppressions from a suppressions file, etc.
@@ -518,7 +518,7 @@ While writing these functions requires some work, it's much less
 than doing error handling from scratch because the core is doing
 most of the work.  See the type
 <computeroutput>VgNeeds</computeroutput> in
-<filename>include/vg_skin.h</filename> for full details of all
+<filename>include/tool.h</filename> for full details of all
 the needs.</para>
 
 <para>Third, the tool can indicate which events in core it wants
@@ -538,7 +538,7 @@ be called each time this happens.</para>
 
 <para>More information about "details", "needs" and "trackable
 events" can be found in
-<filename>include/vg_skin.h</filename>.</para>
+<filename>include/tool.h</filename>.</para>
 
 </sect2>
 
@@ -547,7 +547,7 @@ events" can be found in
 <sect2 id="writing-tools.instr" xreflabel="Instrumentation">
 <title>Instrumentation</title>
 
-<para><computeroutput>SK_(instrument)()</computeroutput> is the
+<para><computeroutput>TL_(instrument)()</computeroutput> is the
 interesting one.  It allows you to instrument
 <emphasis>UCode</emphasis>, which is Valgrind's RISC-like
 intermediate language.  UCode is described in 
@@ -587,7 +587,7 @@ quite complex and not brilliantly documented.  Here are some
 important points, but there are undoubtedly many others that I
 should note but haven't thought of.</para>
 
-<para>The file <filename>include/vg_skin.h</filename> contains
+<para>The file <filename>include/tool.h</filename> contains
 all the types, macros, functions, etc. that a tool should
 (hopefully) need, and is the only <filename>.h</filename> file a
 tool should need to
@@ -597,23 +597,23 @@ tool should need to
 C library (there are deep reasons for this, trust us).  Valgrind
 provides an implementation of a reasonable subset of the C
 library, details of which are in
-<filename>vg_skin.h</filename>.</para>
+<filename>tool.h</filename>.</para>
 
 <para>Similarly, when writing a tool, you shouldn't need to look
 at any of the code in Valgrind's core.  Although it might be
 useful sometimes to help understand something.</para>
 
-<para><filename>vg_skin.h</filename> has a reasonable amount of
+<para><filename>tool.h</filename> has a reasonable amount of
 documentation in it that should hopefully be enough to get you
 going.  But ultimately, the tools distributed (Memcheck,
 Addrcheck, Cachegrind, Lackey, etc.) are probably the best
 documentation of all, for the moment.</para>
 
 <para>Note that the <computeroutput>VG_</computeroutput> and
-<computeroutput>SK_</computeroutput> macros are used heavily.
+<computeroutput>TL_</computeroutput> macros are used heavily.
 These just prepend longer strings in front of names to avoid
 potential namespace clashes.  We strongly recommend using the
-<computeroutput>SK_</computeroutput> macro for any global
+<computeroutput>TL_</computeroutput> macro for any global
 functions and variables in your tool, or writing a similar
 macro.</para>
 
@@ -703,7 +703,7 @@ instrumentation.</para>
 
 <para>If you just want to know whether a program point has been
 reached, using the <computeroutput>OINK</computeroutput> macro
-(in <filename>include/vg_skin.h</filename>) can be easier than
+(in <filename>include/tool.h</filename>) can be easier than
 using GDB.</para>
 
 <para>The other debugging command line options can be useful too
@@ -1136,7 +1136,7 @@ and then use the <computeroutput>VGP_PUSHCC</computeroutput> and
 <computeroutput>VGP_POPCC</computeroutput> macros to record time
 spent doing certain things.  New profiling event numbers must not
 overlap with the core profiling event numbers.  See
-<filename>include/vg_skin.h</filename> for details and Memcheck
+<filename>include/tool.h</filename> for details and Memcheck
 for an example.</para>
 
 </sect2>
index b540bf8fcae2cbe7e84e266b6d789cee7c61a3e6..b8186f1b80b1b25c1bb54e302fa8eb01cf6bc91e 100644 (file)
@@ -421,43 +421,56 @@ are robust to mismatch in <computeroutput>new</computeroutput> /
 <title>Passing system call parameters with inadequate read/write
 permissions</title>
 
-<para>Memcheck checks all parameters to system calls.  If a
-system call needs to read from a buffer provided by your program,
-Memcheck checks that the entire buffer is addressible and has
-valid data, ie, it is readable.  And if the system call needs to
-write to a user-supplied buffer, Memcheck checks that the buffer
-is addressible.  After the system call, Memcheck updates its
-administrative information to precisely reflect any changes in
-memory permissions caused by the system call.</para>
-
-<para>Here's an example of a system call with an invalid
-parameter:</para>
+<para>Memcheck checks all parameters to system calls, i.e:
+<itemizedlist>
+  <listitem><para>It checks all the direct parameters
+  themselves.</para></listitem> 
+  <listitem><para>Also, if a system call needs to read from a buffer provided
+  by your program, Memcheck checks that the entire buffer is addressible and
+  has valid data, ie, it is readable.</para></listitem>
+  <listitem><para>Also, if the system call needs to write to a user-supplied
+  buffer, Memcheck checks that the buffer is addressible.</para></listitem>
+</itemizedlist>
+</para>
+
+<para>After the system call, Memcheck updates its tracked information to
+precisely reflect any changes in memory permissions caused by the system call.
+</para>
+
+<para>Here's an example of two system calls with invalid parameters:</para>
 <programlisting><![CDATA[
-#include <stdlib.h>
-#include <unistd.h>
-int main( void )
-{
-  char* arr = malloc(10);
-  (void) write( 1 /* stdout */, arr, 10 );
-  return 0;
-}]]></programlisting>
+  #include &lt;stdlib.h>
+  #include &lt;unistd.h>
+  int main( void )
+  {
+    char* arr  = malloc(10);
+    int*  arr2 = malloc(sizeof(int));
+    write( 1 /* stdout */, arr, 10 );
+    exit(arr2[0]);
+  }
+]]></programlisting>
 
-<para>You get this complaint ...</para>
+<para>You get these complaints ...</para>
 <programlisting><![CDATA[
-Syscall param write(buf) contains uninitialised or unaddressable byte(s)
-   at 0x4035E072: __libc_write
-   by 0x402A6E5E: __libc_start_main (libc-start.c:129)
-   by 0x80483B1: (within tests/badwrite)
-   by <bogus frame pointer> ???
-   Address 0x3807E6D0 is 0 bytes inside a block of size 10 alloc'd
-   at 0x4004FEE6: malloc (ut_clientmalloc.c:539)
-   by 0x80484A0: main (tests/badwrite.c:6)
-   by 0x402A6E5E: __libc_start_main (libc-start.c:129)
-   by 0x80483B1: (within tests/badwrite)
+  Syscall param write(buf) points to uninitialised byte(s)
+     at 0x25A48723: __write_nocancel (in /lib/tls/libc-2.3.3.so)
+     by 0x259AFAD3: __libc_start_main (in /lib/tls/libc-2.3.3.so)
+     by 0x8048348: (within /auto/homes/njn25/grind/head4/a.out)
+   Address 0x25AB8028 is 0 bytes inside a block of size 10 alloc'd
+     at 0x259852B0: malloc (vg_replace_malloc.c:130)
+     by 0x80483F1: main (a.c:5)
+
+  Syscall param exit(error_code) contains uninitialised byte(s)
+     at 0x25A21B44: __GI__exit (in /lib/tls/libc-2.3.3.so)
+     by 0x8048426: main (a.c:8)
 ]]></programlisting>
 
-<para>... because the program has tried to write uninitialised
-junk from the malloc'd block to the standard output.</para>
+<para>... because the program has (a) tried to write uninitialised junk from
+the malloc'd block to the standard output, and (b) passed an uninitialised
+value to <computeroutput>exit</computeroutput>.  Note that the first error
+refers to the memory pointed to by <computeroutput>buf</computeroutput> (not
+<computeroutput>buf</computeroutput> itself), but the second error refers to
+the argument <computeroutput>error_code</computeroutput> itself.</para>
 
 </sect2>
 
index 492902c158e2e1ebd26f3ca152ad2435fef90c57..cf37f314a6e14756baf79d3a9ad53062ef8ae18c 100644 (file)
@@ -22,7 +22,8 @@ thoroughly.</para>
 <para>You may need to read this document several times, and
 carefully.  Some important things, I only say once.</para>
 
-
+<para>[Note: this document is now very old, and a lot of its contents are out
+of date, and misleading.]</para>
 
 
 <sect2 id="mc-tech-docs.history" xreflabel="History">