The "coregrind_tools.html" file contains some obsolete documentation
about how to run Valgrind under GDB (i.e. for debugging bugs in
Valgrind and tools, rather than bugs in the program you're running
Valgrind on). The more recently added instructions in
"README_DEVELOPERS" seem to work fine, though. It seems to me that the
HTML documentation should either be updated with up-to-date
instructions, or replaced with a pointer to the README file.
The appended patch, for instance, implements the latter fix.
-- Stephen
Index: coregrind/docs/coregrind_tools.html
===================================================================
RCS file: /home/kde/valgrind/coregrind/docs/coregrind_tools.html,v
retrieving revision 1.3
diff -u -r1.3 coregrind_tools.html
--- coregrind/docs/coregrind_tools.html 2 Sep 2004 08:51:41 -0000 1.3
+++ coregrind/docs/coregrind_tools.html 9 Nov 2004 22:25:27 -0000
@@ -28,7 +28,7 @@
<h1 align=center>Valgrind Tools</h1>
<center>
A guide to writing new tools for Valgrind<br>
- This guide was last updated on 20030520
+ This guide was last updated on 20041109
</center>
<p>
@@ -541,39 +541,9 @@
Writing and debugging tools is not trivial. Here are some suggestions for
solving common problems.<p>
-If you are getting segmentation faults in C functions used by your tool, the
-usual GDB command:
-<blockquote><code>gdb <i>prog</i> core</code></blockquote>
-usually gives the location of the segmentation fault.<p>
-
If you want to debug C functions used by your tool, you can attach GDB to
-Valgrind with some effort:
-<ul>
- <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) {
- Int p, q;
- for (p = 0; p < 50000; p++)
- for (q = 0; q < 50000; q++) ;
- }
-</pre>
- </li><p>
- and rebuild Valgrind.
-
- <li>Then run:
- <blockquote><code>valgrind <i>prog</i></code></blockquote>
-
- Valgrind starts the program, printing its process id, and then delays for
- a few seconds (you may have to change the loop bounds to get a suitable
- delay).</li><p>
-
- <li>In a second shell run:
-
- <blockquote><code>gdb <i>prog</i> <i>pid</i></code></blockquote></li><p>
-</ul>
+Valgrind with some effort; see the file <code>README_DEVELOPERS</code> in CVS
+for instructions.<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>,
|