I would like to use valgrind to detect leaks on iPhoneSimulator. I got the source for valgrind, compiled and installed. Added the following to my code
int main(int argc, char *argv[]) {
#ifdef VALGRIND_REXEC
if (argc = 2 && strcmp(argv[1], "-valgrind") != 0)) {
execl(VALGRIND, VALGRIND, "--leak-check=full", "--dsymutil=yes", argv[0], "-valgrind", NULL);
}
#endif
VALGRIND_REXEC is defined, when I try to Debug or Run my application I get the following error in the console
[Session started at 2011-03-14 16:21:27 +0000.]
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
open$UNIX2003 called from function main in image valgrind.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.
Mac 10.6.5 Xcode 3.2.5 iOS 4.2
Do I need to compile valgrind in any special way, what am I doing wrong?