|
From: Nicholas N. <nj...@ca...> - 2003-08-19 07:45:39
|
On Mon, 18 Aug 2003, Jason Gauthier wrote:
> Is it possible to actually link against a valgrind library, or can one only
> run it through the executable?
Let's see:
[~/grind/annelid] gcc a.o memcheck/vgskin_memcheck.so coregrind/valgrind.so
[~/grind/annelid] VG_ARGS=--suppressions=default.supp; a.out
==26034== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==26034== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==26034== Using valgrind-20030725, a program supervision framework for x86-linux.
==26034== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==26034== Estimated CPU clock rate is 1404 MHz
==26034== For more details, rerun with: -v
==26034==
==26034==
==26034== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==26034== malloc/free: in use at exit: 0 bytes in 0 blocks.
==26034== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==26034== For a detailed leak analysis, rerun with: --leak-check=yes
==26034== For counts of detected errors, rerun with: -v
So the answer seems to be yes, with some provisos:
- You have to link with a particular skin. I linked with Memcheck
above.
- You have to put the skin .so before valgrind.so when linking.
- You have to setup $VG_ARGS, by adding a --suppressions= entry, at the
least.
I'd be interested to know why you want to do this.
N
|