<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">kalyan ponnala</b> <span dir="ltr"><<a href="mailto:ponnala.kalyan@gmail.com">ponnala.kalyan@gmail.com</a>></span><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 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 guess) but i am not able to see whats going on inside the lexer and parser as the debugger goes on with the helloworld.c program. I am not sure of what 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 --nothing happened<br>clang -cc1 -fsyntax-only helloworld.c -fms-extensions -x c helloworld.c<div class="im"><br><br>clang -fsyntax-only helloworld.c -###<br>
</div>
etc etc...<br><br>I set the breakpoints as you said charles. what more should I do? The .c file is inside a visual studio project but I am accessing it through the command line. Is it fine? Do I have to add some commands or paths to the visual studio project file of helloworld.c ?<br>

<br>Thanks.<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Wed, Feb 24, 2010 at 8:00 PM, Charles Davis <span dir="ltr"><<a href="mailto:cdavis@mymail.mines.edu" target="_blank">cdavis@mymail.mines.edu</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;">
<div>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>
</div>No, no, you want to put the breakpoint on Lexer::Lex(). It's in the<br>
clangLex target, in Lexer.h.<br>
<div>><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>
</div>Good.<br>
<div>><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>
</div>That is because you need to also pass -fms-extensions to use clang with<br>
MS headers.<br>
<br>
Chip<br>
<br>
</blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br>Kalyan Ponnala<br>phone: 8163772059<br>
</font></div><br><br clear="all"><br>-- <br>Kalyan Ponnala<br>phone: 8163772059<br>