]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add an FAQ about attaching Valgrind to already-running programs.
authorNicholas Nethercote <njn@valgrind.org>
Tue, 6 Jan 2009 05:54:45 +0000 (05:54 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 6 Jan 2009 05:54:45 +0000 (05:54 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8911

docs/xml/FAQ.xml

index cc7607d097793ab2ec8441ab79ec3145ff7a5dfe..8958b3a40c60b5deedb9afcaf85a89e560bd8d55 100644 (file)
@@ -567,6 +567,29 @@ int main(void)
 </qandaentry>
 
 
+<qandaentry id="faq.attach">
+  <question id="q-attach">
+    <para>Is it possible to attach Valgrind to a program that is already
+    running?</para>
+  </question>
+  <answer id="a-undeferrors">
+    <para>No.  The environment that Valgrind provides for running programs
+    is significantly different to that for normal programs, e.g. due to
+    different layout of memory.  Therefore Valgrind has to have full control
+    from the very start.</para>
+
+    <para>It is possible to achieve something like this by running your
+    program without any instrumentation (which involves a slow-down of about
+    5x, less than that of most tools), and then adding instrumentation once
+    you get to a point of interest.  Support for this must be provided by
+    the tool, however, and Callgrind is the only tool that currently has
+    such support.  See the instructions on the
+    <computeroutput>callgrind_control</computeroutput> program for details.
+    </para>
+  </answer>
+</qandaentry>
+
+
 </qandadiv>