From: François-Xavier C. <fx....@ya...> - 2020-06-25 23:21:08
|
On Thu, Jun 25, 2020 at 09:49:35PM +0200, Paul FLOYD wrote: > > > De : "François-Xavier Carton via Valgrind-users" > > > Hi, I have a program that calls exec without forking. I would like to run that program under valgrind > > and get a summary report for the code before the call to exec. > > I don't want to trace the exec'ed program, so the --trace-children option does not do what I want. > > Is there a way to have valgrind output the error/leak summary before exec (without tracing after exec)? > > Hi Francois-Xavier > > Sure, this is possible. There are two possible things that you can do > > 1. Use vgdb. To do this you run Valgrind and your test app in one terminal and in a second > terminal you run gdb which connects to the first. In the gdb terminal you can issue > most of the usual commands like 'break' and 'continue'. Before the exec you can do > 'monitor leak_check full'. See > https://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.monitor-commands > for details. > > 2. Use client requests. To do this you need to make some small changes to your code. > You need to include memcheck.h, then just before your exec() insert > > VALGRIND_DO_LEAK_CHECK; > > For more details, see also the manual. > > A+ > Paul > Hi Paul, Thanks! I will try to go with 2., because I would like to automate that. François-Xavier |