From: Nicholas Nethercote Date: Tue, 6 Jan 2009 05:54:45 +0000 (+0000) Subject: Add an FAQ about attaching Valgrind to already-running programs. X-Git-Tag: svn/VALGRIND_3_5_0~1121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa7ee0dc5ba300f436ccab0f7a7ec54c71287cff;p=thirdparty%2Fvalgrind.git Add an FAQ about attaching Valgrind to already-running programs. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8911 --- diff --git a/docs/xml/FAQ.xml b/docs/xml/FAQ.xml index cc7607d097..8958b3a40c 100644 --- a/docs/xml/FAQ.xml +++ b/docs/xml/FAQ.xml @@ -567,6 +567,29 @@ int main(void) + + + Is it possible to attach Valgrind to a program that is already + running? + + + 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. + + 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 + callgrind_control program for details. + + + + +