[LLVMdev] Debugging the static analyzer

Dmitri Gribenko gribozavr at gmail.com
Tue Mar 11 11:10:58 PDT 2014


On Tue, Mar 11, 2014 at 5:37 PM, Ricky Joudrey <rjoudrey at mail.usf.edu> wrote:
> Hello,
>
> I’m working on implementing a Clang static analyzer checker, but I’m having
> trouble debugging. The issue is that when inserting breakpoints through
> Xcode, the only breakpoints that are triggered during a ‘Build and Run’ are
> those located in the files in Clang executable target ‘Compile Sources’
> build phase (i.e. driver.cpp). Breakpoints placed within files in the
> clangStaticAnalyzerCheckers library are not triggered. The same issue occurs
> when debugging the Clang executable using lldb through bash.

Clang has a driver and the frontend, they are the same executable but
separate processes.  More information here:

http://clang.llvm.org/docs/FAQ.html

To debug Clang, you need to figure out the frontend -cc1 command line
(invoke the driver with -### option in addition to usual ones), or use
a feature in your debugger to attach to child processes.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/




More information about the llvm-dev mailing list