Hi,
is it possible to profile C++ apps with Xcode so one gets;
- memory leaks like with valgrind
- possible errors before running the program
Thanks, I am very new to mac and xcode
Where can one find a good tutorial for this?
Hi,
is it possible to profile C++ apps with Xcode so one gets;
Thanks, I am very new to mac and xcode
Where can one find a good tutorial for this?
Hi
This is a bit outside my current core competencies, but I've spotted a tool called Shark on my Mac which offers profiling and optimisation support. There are other Xcode tools too. But I've not yet used any of them for real. And I have no experience of valgrind on the Mac.
Not much of an answer, I know.
Regards
Mark
You have a tool called Instruments, a free Apple tool included in XCode, that catches most of those errors.
You can find information about this tool here
possible errors before running the program
Xcode 3.2 now comes with static analysis tool powered by Clang, which will detect logical errors such as unreleased memory at compile time.
It is just in Build > Build and Analyze menu.
Read Apple's documentation to get more detail.
Instruments is a great tool, as @pau.estalella says. Valgrind support for Mac OS X is now in the main Valgrind repository, courtesy of Greg Parker.
Regarding memory leaks, run XCode and then launch Start with Performance Tool
-> Leaks
Alternatively and necessarily for old pre-Panther users of XCode, it is possible to debug with guard malloc
, detailed explanation in the Mac development docs, but quick walk-through is here and here