From: Alex I. <ale...@in...> - 2003-05-28 19:56:42
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> Thank you Paul and everyone who replied - I got it working perfectly now! <p>Regards, <br>Alex <p>Paul Haas wrote: <blockquote TYPE=CITE>On Tue, 27 May 2003, Alex Ivershen wrote: <p>> Hi all, <p>> I have an application that spawns quite a few children processes. These <br>> children cannot be run standalone, they have to spawned by that master <br>> process.? What I would like to do is to spawn just one of the children <br>> with Valgrind. I can tell the master application which child to spawn <br>> with Valgrind via a command-line switch, but the actual spawning is where <br>> I am at a loss.? The master app is doing an execl() call,? so I would <br>> need to explicitly list all Valgrind options in that call and then the <br>> application name. This is not very useful since I won't be able to change <br>> skins and options on the fly. <br>> <br>> One way I could do it is tweak Valgrind code to read options from an <br>> environment variable, say VALGRIND_OPTS="-v --logfile=/tmp/VLOG" <br>> --leak-check=yes" and then in execl() call do something like: <p>Write a 2 line script ValgrindWithOptions, which does: <p>#!/bin/sh <br>exec valgrind $VALGRIND_OPTS $* <p>You can replace the 2 line script with a program in your language of <br>choice, assuming your language of choice supports some form of exec() and <br>won't trample any state information (like file descriptors) that the <br>parent process sends to the child. <p>> if ( valgrind switch is set ) <br>> ??? execl ( ... , "valgrind", "Application", .... ) <p> ??? execl ( ... , "ValgrindWithOptions", "Application", .... ) <p>Or if there is enough information, you could rename "Application" and call <br>your script Application. Then your script gets more complicated, because <br>it would have to figure out which child process should be valgrind'ed. <p>> else <br>> ??? execl ( ... , "Application", ... ) <p>> I would rather not modify Valgrind source, since I would have to carry <br>> over changes between Valgrind versions. Is there any easier? way to do <br>> what I am trying to accomplish?? Any help would be greatly appreciated! <p>> Thanks! <br>> Alex Ivershen <br>> <br>> --? <br>> Alex G. Ivershen??????????????????????????? Inet Technologies, Inc. <br>> Network Products Dept.????????????????????? 1500 N. Greenville Ave. <br>> Inet Technologies Inc.????????????????????? Richardson, TX 75081 <br>> Phone: +1-469-330-4295????????????????????? USA <br>> <br>> "Black Holes are where God divided by zero" <br>> ? ------------------------------------------------------- This SF.net <br>> email is sponsored by: ObjectStore. If flattening out C++ or Java code to <br>> make your application fit in a relational database is painful, don't do <br>> it! Check out ObjectStore. Now part of Progress Software. <br>> <a href="http://www.objectstore.net/sourceforge">http://www.objectstore.net/sourceforge</a> <br>> _______________________________________________ Valgrind-users mailing <br>> list Val...@li... <br>> <a href="https://lists.sourceforge.net/lists/listinfo/valgrind-users">https://lists.sourceforge.net/lists/listinfo/valgrind-users</a> <br>></blockquote> <pre>-- Alex G. Ivershen Inet Technologies, Inc. Network Products Dept. 1500 N. Greenville Ave. Inet Technologies Inc. Richardson, TX 75081 Phone: +1-469-330-4295 USA "Black Holes are where God divided by zero"</pre> </html> |