Bug 143820

Summary: Checking programs that have /bin/sh wrapper scripts is inconvenient
Product: [Developer tools] valgrind Reporter: Stephen McCracken <kdebugzilla>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED DUPLICATE    
Severity: normal CC: njn
Priority: NOR    
Version: 3.2.3   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Stephen McCracken 2007-04-04 05:24:36 UTC
Version:           3.2.3 (using KDE KDE 3.5.6)
Installed from:    RedHat RPMs
OS:                Linux

I frequently wish to run valgrind on applications that have long and complicated /bin/sh wrapper scripts.  Typically, the wrapper scripts call lots of utility programs (uname/sed/awk/find/...) before finally executing the main executable.  I want valgrind to run only on the main executable, not the utility programs.  However, --trace-children=yes will pick up everything, which slows things down and spews uninteresting output.

The final invocation usually falls into one of the following types:

  # direct exec
  exec $COMPUTED_PATH/main_exe

  # extra eval for arg splicing
  eval exec $COMPUTED_PATH/main_exe $some_args $more_args

  # just run a subprocess
  $COMPUTED_PATH/main_exe

Currently (vg 3.2.3), without --trace-children=yes, valgrind does not trace into main_exe for any of these cases.  If possible, I'd like to see the first two fixed so that valgrind can automatically follow the "exec" calls.  For the final case, perhaps there could be a new valgrind option to specify by name which children to trace, e.g:

   --trace-children-named=main_exe
Comment 1 Nicholas Nethercote 2009-06-29 09:52:01 UTC

*** This bug has been marked as a duplicate of bug 148932 ***