<p>
<center>
-<a href="mailto:jseward@acm.org">jseward@acm.org</a><br>
-Copyright © 2000-2002 Julian Seward
+<a href="mailto:njn25@cam.ac.uk">njn25@cam.ac.uk</a><br>
+Nick Nethercote, October 2002
<p>
Valgrind is licensed under the GNU General Public License,
version 2<br>
These examples give a reasonable idea of what kinds of things Valgrind can be
used for. The instrumentation can range from very lightweight (e.g. counting
-the number of times a particular functin is called) to very intrusive (e.g.
+the number of times a particular function is called) to very intrusive (e.g.
memcheck's memory checking).
<a name="howskinswork"</a>
If you want to debug C functions used by your skin, you can attach GDB to
Valgrind with some effort:
<ul>
- <li>Uncomment the following code in <code>coregrind/vg_main.c</code>:
+ <li>Enable the following code in <code>coregrind/vg_main.c</code> by
+ changing <code>if (0)</code> into <code>if (1)</code>:
<pre>
/* Hook to delay things long enough so we can get the pid and
attach GDB in another shell. */
-#if 0
- {
+ if (0) {
Int p, q;
for (p = 0; p < 50000; p++)
for (q = 0; q < 50000; q++) ;
}
-#endif</pre>
</li><p>
and rebuild Valgrind.
<blockquote><code>gdb <i>prog</i> <i>pid</i></code></blockquote></li><p>
</ul>
-GDB may be able to give you useful information.<p>
+GDB may be able to give you useful information. Note that by default
+most of the system is built with <code>-fomit-frame-pointer</code>,
+and you'll need to get rid of this to extract useful tracebacks from
+GDB.<p>
If you just want to know whether a program point has been reached, using the
<code>OINK</code> macro (in <code> include/vg_skin.h</code>) can be easier than