[cfe-dev] How to debug Clang code

Nikola Smiljanic popizdeh at gmail.com
Mon Mar 19 23:58:32 PDT 2012


Make sure your argument is "-cc1 test.c" as that will invoke the
frontend, without it clang acts as a compiler driver and invokes
another instance of clang.

On Tue, Mar 20, 2012 at 5:37 AM, srikanth vaindam
<srikanth.vaindam at gmail.com> wrote:
> 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.
>
> I have set a "test.c" file as an argument in the debug configurations.
> Went to Run-> Debug As-> Local C/C++ Application.
> It asked "Choose local application to debug". I chose "clang" and clicked
> OK.
> It started building the code. build completed.
> Stopped at main() in the debug window. (No source available for main())
> 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
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list