Reputation: 2441
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?
Upvotes: 11
Views: 18081
Reputation: 38972
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 here is a quick walk-through.
Upvotes: 5
Reputation: 78374
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.
Upvotes: 1
Reputation: 2243
You have a tool called Instruments, a free Apple tool included in XCode, that catches most of those errors.
Upvotes: 9
Reputation:
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.
Upvotes: 4
Reputation: 10126
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.
Upvotes: 2