<span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px">Hi all,<div><br></div><div>I'm trying to debug lldb to see where the active thread gets unselected, using my patch for the "frame return" command.</div>
<div><br></div><div>But I'm having some problems. Most of the time, I can't evaluate C++ expressions, like "m_threads[idx]" (missing symbol: …), or "process->GetSelectedThread()" (call is ambiguous, but no candidates are given).</div>
<div>Since I was having these errors, I tried checking out if I could find those candidates while clang parsed the AST.</div><div><br></div><div>Right now, I'm running a test program in lldb in lldb in lldb… It's not that fun :-)</div>
<div><br></div><div>I will stop the bottom debugger in CommandObjectThread.cpp:413 and, in the middle lldb, run the command:</div><div><div> frame #0: 0x000000010031d875 LLDB`CommandObjectThreadStepWithTypeAndScope::Execute(lldb_private::Args&, lldb_private::CommandReturnObject&) + 197 at CommandObjectThread.cpp:413</div>
<div> 410 <span style="white-space:pre-wrap"> </span> else</div><div> 411 <span style="white-space:pre-wrap"> </span> {</div><div> 412 <span style="white-space:pre-wrap"> </span> const uint32_t num_threads = process->GetThreadList().GetSize();</div>
<div>-> 413 <span style="white-space:pre-wrap"> </span> Thread *thread = NULL;</div><div> 414 <span style="white-space:pre-wrap"> </span></div><div> 415 <span style="white-space:pre-wrap"> </span> if (command.GetArgumentCount() == 0)</div>
<div> 416 <span style="white-space:pre-wrap"> </span> {</div><div>1) expr process->GetThreadList()</div></div><div><br></div><div><br></div><div>This command, normally, will error out with:</div><div><div>
error: call to member function 'GetThreadList' is ambiguous</div><div>note: candidate function</div><div>note: candidate function</div><div>error: 1 errors parsing expression</div></div><div><br></div><div>Not listing the candidate functions (as it should?). If I stop that lldb, I can't check the Diagnostic object (with the outermost lldb):</div>
<div><div> frame #0: 0x000000010042b182 LLDB`clang::CompilerInstance::getDiagnostics() const + 114 at CompilerInstance.h:254</div><div> 251 <span style="white-space:pre-wrap"> </span> /// Get the current diagnostics engine.</div>
<div> 252 <span style="white-space:pre-wrap"> </span> Diagnostic &getDiagnostics() const {</div><div> 253 <span style="white-space:pre-wrap"> </span> assert(Diagnostics && "Compiler instance has no diagnostics!");</div>
<div>-> 254 <span style="white-space:pre-wrap"> </span> return *Diagnostics;</div><div> 255 <span style="white-space:pre-wrap"> </span> }</div><div> 256 <span style="white-space:pre-wrap"> </span></div>
<div> 257 <span style="white-space:pre-wrap"> </span> /// setDiagnostics - Replace the current diagnostics engine.</div><div>0) expr *(Diagnostics.Obj)</div><div>Assertion failed: (D && "Cannot get layout of forward declarations!"), function getASTRecordLayout, file RecordLayoutBuilder.cpp, line 1835.</div>
<div>[1] 73430 illegal hardware instruction lldb</div></div><div><br></div><div>This triggers an assert and shuts down clang. I have built lldb with the debug version of llvm+clang, as it says on the docs/ folder.</div>
<div><br></div><div>Shouldn't clang+lldb be able to get that information? Any clues on where the bug might lie? (clang? lldb?)</div><div><br></div><div>Regards,nbsp; Filipe Cabecinhas<br><br></div><div>P.S: XCode blows up, too, which shouldn't happen.</div>
</span>