Your code can be compiled in either mode. It makes more sense to profile the release version, since that has the compiler optimizations and should execute with the performance characteristics that you care about. Most compilers allow you to generate debug symbols for release builds. When the debug symbols are generated and available, then CodeAnalyst will use them to provide source line annotations of the profile information.
Using Microsoft Visual Studio, the usual flag for the compilation is /Zi and linking uses /DEBUG. For GCC, the usual flag is -g.