[cfe-dev] How to debug Clang code

srikanth vaindam srikanth.vaindam at gmail.com
Mon Mar 19 21:37:15 PDT 2012


Hi,
I am a student and new to Clang. I want to know the development tools that
you use.
what I exactly wanted to know is, how do you debug the code.


I am trying to debug Clang using Eclipse. I have put a break point in
clang/lib/lex/preprocessor.cpp at the preprocessor's constructor.

   1. I have set a "test.c" file as an argument in the debug configurations.
   2. Went to Run-> Debug As-> Local C/C++ Application.
   3. It asked "Choose local application to debug". I chose "clang" and
   clicked OK.
   4. It started building the code. build completed.
   5. Stopped at main() in the debug window. (No source available for
   main())
   6. After some step overs, it says "terminated: gdb Debugger (Exited.
   Exit code=255)"

I am not taken to the clang code (preprocessor code). can someone please
tell me how to debug the clang code.? I want to see the code flow in clang.
and how clang is constructing the AST.

Best Regards,
Srikanth Vaindam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120320/1b74cfaf/attachment.html>


More information about the cfe-dev mailing list