<br>Thanks charles, ted, and yun. It works. I can step through the clang parser and lexer now. <br><br>I would like to know if we can add the -fms-extensions options to the "clang-test" target. I could not build the regression tests until now. It give me fatal errors saying " 'stdio.h' file not found.. 'stdlib.h' not found etc." <br>
<br>Thanks.<br><br><div class="gmail_quote">On Wed, Feb 24, 2010 at 11:04 PM, Yun Chen <span dir="ltr"><<a href="mailto:yun.go.chen@gmail.com">yun.go.chen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
You open LLVM.sln. Set "clang" project as the "Start up" project.<br>
<br>
Then on project properties for "clang", under "Debugging" section, you<br>
set Command Arguments to something like this:<br>
-cc1 -fms-extensions -fsyntax-only G:\tmp\t.cpp<br>
<br>
Then you set a breakpoint in cc1_main, for example at "ExecuteAction".<br>
Step into it and it should not take long to see it in action.<br>
<div><div></div><div class="h5"><br>
<br>
On Wed, Feb 24, 2010 at 8:46 PM, kalyan ponnala<br>
<<a href="mailto:ponnala.kalyan@gmail.com">ponnala.kalyan@gmail.com</a>> wrote:<br>
><br>
><br>
> ---------- Forwarded message ----------<br>
> From: kalyan ponnala <<a href="mailto:ponnala.kalyan@gmail.com">ponnala.kalyan@gmail.com</a>><br>
> Date: Wed, Feb 24, 2010 at 8:42 PM<br>
> Subject: Re: [cfe-dev] How to check the flow of the clang compiler with an<br>
> example<br>
> To: Charles Davis <<a href="mailto:cdavis@mymail.mines.edu">cdavis@mymail.mines.edu</a>><br>
><br>
><br>
> Thanks for the reply guys. I am able to run those commands correctly (I<br>
> guess) but i am not able to see whats going on inside the lexer and parser<br>
> as the debugger goes on with the helloworld.c program. I am not sure of what<br>
> is happening there as it does not show any output.<br>
> I tried these commands:<br>
> clang -cc1 -fms-extensions helloworld.c    -----it worked but no output<br>
> --nothing happened<br>
> clang -cc1 -fsyntax-only helloworld.c -fms-extensions -x c helloworld.c<br>
><br>
> clang -fsyntax-only helloworld.c -###<br>
> etc etc...<br>
><br>
> I set the breakpoints as you said charles. what more should I do? The .c<br>
> file is inside a visual studio project but I am accessing it through the<br>
> command line. Is it fine? Do I have to add some commands or paths to the<br>
> visual studio project file of helloworld.c ?<br>
><br>
> Thanks.<br>
><br>
> On Wed, Feb 24, 2010 at 8:00 PM, Charles Davis <<a href="mailto:cdavis@mymail.mines.edu">cdavis@mymail.mines.edu</a>><br>
> wrote:<br>
>><br>
>> kalyan ponnala wrote:<br>
>> >  Hi,<br>
>> > Thanks for the reply. I tried putting breakpoints at CIndex.cpp file in<br>
>> > CIndex target near<br>
>> ><br>
>> > Lexer Lex(SourceMgr.getLocForStartOfFile(BeginLocInfo.first),<br>
>> ><br>
>> >             CXXUnit->getASTContext().getLangOptions(),<br>
>> ><br>
>> >             Buffer.first, Buffer.first + BeginLocInfo.second,<br>
>> > Buffer.second);<br>
>> No, no, you want to put the breakpoint on Lexer::Lex(). It's in the<br>
>> clangLex target, in Lexer.h.<br>
>> ><br>
>> > and another breakpoint at Parser.cpp inside clangparser target.<br>
>> ><br>
>> > bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result) {<br>
>> ><br>
>> >   Result = DeclGroupPtrTy();<br>
>> ><br>
>> >   if (Tok.is(tok::eof)) {<br>
>> ><br>
>> >     Actions.ActOnEndOfTranslationUnit();<br>
>> ><br>
>> >     return true;<br>
>> ><br>
>> >   }<br>
>> Good.<br>
>> ><br>
>> > When I tried to run the command clang -cc1 helloworld.c on the command<br>
>> > line , it generates 5 diagnostic messages saying error: unknown type<br>
>> > __int64 /*64-bit time value*/ and shows me different places inside<br>
>> > stdio.h and crtdefs.h.<br>
>> That is because you need to also pass -fms-extensions to use clang with<br>
>> MS headers.<br>
>><br>
>> Chip<br>
>><br>
><br>
><br>
><br>
> --<br>
> Kalyan Ponnala<br>
> phone: 8163772059<br>
><br>
><br>
><br>
> --<br>
> Kalyan Ponnala<br>
> phone: 8163772059<br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Kalyan Ponnala<br>phone: 8163772059<br>