tags:

views:

21

answers:

1

Hello there,

I wanted to do some Memory-Leak tracking on my App, but somehow I am not able to run Clang Static Analyzer because I always get an error message saying "command not found" when executing it with the terminal.

There was no ".bash_profile" file on my mac, so I created one. Is there anything missing?

Here is a picture of my setup: ht*tp://img225.imageshack.us/img225/8749/screenshot1eu.png

A: 

With your new profile, the system is now finding scan-build, but scan-build cannot run without being able to find perl. Your PATH variable is preventing the system from finding perl and xcodebuild. If you want to add /Users/Kay/bin/clang to your path, do this in your profile instead:

export PATH="$PATH:$HOME/bin/clang"

This will append that path to the pre-existing search list.

Xcode can run the static analyzer for you. Open the project build settings, search for "analyzer", then check the checkbox next to "Run Clang static analyzer." The results are presented by Xcode both in the Details tab and as annotations on your project source code.

Also, note that the Clang static analyzer is exactly that: a static analyzer. It will not observe the dynamic, runtime behavior of your application. For that, you should use Instruments: within Xcode, go to Run > Run with Performance Tool > Leaks.

Jeremy W. Sherman
Thank you very much Jeremy, I will use that built-in functionality of Xcode, didn't notice that yet! :)
Steven