[cfe-dev] How to debug clang?

mats petersson mats at planetcatfish.com
Tue Mar 10 03:23:58 PDT 2015


When I need to do this, I typically run `clang -v myfile.c`, then grab
the clang -cc1 command-line that is printed, and pass that to the
debugger.

--
Mats

On 10 March 2015 at 02:58, Nikola Smiljanic <popizdeh at gmail.com> wrote:
> Have a look at clang/tools/driver/driver.cpp
>
> Unless you'd like to debug the driver itself you'll need to run clang with
> -cc1 and put a breakpoint in cc1_main.
>
> On Tue, Mar 10, 2015 at 12:59 PM, 汪雷 <wangcppclei at gmail.com> wrote:
>>
>> Now I want to read the clang source code, but I can't find the main
>> function where clang begin to run. So I am ready to debug the clang using
>> gdb or lldb, I don't know how to do it? Is there anyone who can help me?
>> Thinks a lot.
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>
> _______________________________________________
> 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