<div dir="ltr">You need to pass argument "-cc1" to the compiler in debug session. In your case parameters must be:<div><span style="font-size:12.8px">-cc1 -std=c++1z -Xclang -ast-dump -fsyntax-only test_deb.cpp</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Without "-cc1" clang works as driver executing other tools to make job, with "-cc1" it works as compiler.</span></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">Thanks,<br>--Serge<br></div></div>
<br><div class="gmail_quote">2016-10-18 14:54 GMT+07:00 Ivan Kush via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>I want to learn clang internals and how it works. But llvm::sys::ExecuteAndWait executes in the debugger and that's all, finish, console output with my AST (I passes to clang "-ast-dump"). It didn't jump in the Lexer.cpp, Sema.cpp, etc. What should I do in the debugger, in order to see how Lexer, Sema work?</div><div> </div><div>My steps in the debugger:</div><div> </div><div>1) compiled debug version of llvm and clang</div><div> </div><div>2) created a source file "test_deb.cpp" with the following code</div><div> </div><div>enum class Enum : int</div><div>{</div><div> kOne,</div><div> kTwo</div><div>};</div><div> </div><div>int f(int x) {</div><div> int result = (x / 42);</div><div> return result;</div><div>}</div><div> </div><div>int main()</div><div>{</div><div> return f(4);</div><div>}</div><div> </div><div>3) launch clang-4.0 in in the debugger with the following parameters:</div><div>-std=c++1z -Xclang -ast-dump -fsyntax-only test_deb.cpp</div><div> </div><div>4) and begin to learn how all work:</div><div>the "int main" in driver.cpp</div><div> </div><div>in driver.cpp is called "ExecuteCompilation" of "Driver"</div><div> TheDriver.ExecuteCompilation(*<wbr>C, FailingCommands); </div><div> </div><div>where called "ExecuteJobs" of "Compilation" (the file Compilation.cpp):</div><div> C.ExecuteJobs(C.getJobs(), FailingCommands);</div><div> </div><div>in the func ExecuteJobs called ExecuteCommand </div><div> if (int Res = ExecuteCommand(Job, FailingCommand)) {</div><div> </div><div>that calls "Execute" of "Command" (the file Jobs.cpp):</div><div> </div><div>where called a func "ExecuteAnddWait" of "llvm::sys"</div><div> </div><div> return llvm::sys::ExecuteAndWait(<wbr>Executable, Argv.data(), /*env*/ nullptr,</div><div> Redirects, /*secondsToWait*/ 0,</div><div> /*memoryLimit*/ 0, ErrMsg,</div><div> ExecutionFailed);</div><div> </div><div>but the "Executable" is "...path/clang-4.0" - the file, that I launched in the debugger o__O</div><div> </div><div>5) so llvm::sys::ExecuteAndWait(<wbr>Executable,...) is called and that's all, finish, console output with my AST. It didn't jump in the Lexer.cpp, Sema.cpp, etc.</div><div> </div><div>What should I do in the debugger, in order to see how Lexer, Sema work?</div></div><span class="HOEnZb"><font color="#888888"><div> </div><div>-- <br>Best wishes,</div><div>Ivan Kush</div><div> </div></font></span><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>