PDA

View Full Version : valgrind for mac




alexmm
Jun 23, 2008, 08:16 AM
Hello, does anybody knows if i can use valgrind on my mac just downloading it from valgrind.org ? As the system is unix based i assume it should work but i am not too sure about it ?
thanks in advance.



kpua
Jun 23, 2008, 09:24 AM
Unfortunately, no. Valgrind uses a lot of OS and CPU specific functionality, so it must be rewritten for each combination. Look at this table: http://valgrind.org/info/platforms.html. Darwin (the Mac OS X kernel) on x86 is considered "high" priority, which is good news. The bad news is, it's been high priority for at least 4 years or more.

yeroen
Jun 23, 2008, 09:26 AM
An x86/Darwin is high priority for the Valgrind team, but there is no port for that yet. The web page has a link to a Free BSD (http://www.freebsd.org/cgi/ports.cgi?query=valgrind) port, which is the closest you're going to get. You can download the source and see if it compiles.

Keep in mind there are other options for memory debugging other than Valgrind.

alexmm
Jun 23, 2008, 10:33 AM
thanks a lot. I only know valgrind. What would be an equivalent running on mac ?
Thanks again.

yeroen
Jun 23, 2008, 10:53 AM
Instruments.app (found somewhere under the Developer/ tree) can trace memory leaks. I haven't used Instruments yet for this purpose, so I can't comment on how it compares to Valgrind. You can read more about it here:

http://developer.apple.com/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/ViewingandAnalyzingData/chapter_6_section_3.html#//apple_ref/doc/uid/TP40004652-CH5-SW22

There's also the 'leaks' command-line utitlity.

alexmm
Jun 23, 2008, 11:55 AM
I'll have a look. Thanks a lot.