<div dir="ltr">I'm trying to get complete stacktraces from C/C++ (backtrace/backtrace_symbols has issues, eg line numbers are often wrong and file name omits full path), and want to use lldb for that.<div><br></div><div>
from the main process A (with pidA), I tried calling lldb in a separate process that attaches to pidA and then prints the backtrace; that works but is slow. </div>
<div><br></div><div>So I'd like A to directly call lldb (via the C++ api) without having to launch a separate process, but can't make it work so far:</div><div><br></div><div>SBDebugger.Create (works)<br></div><div>
CreateTargetWithFileAndArch (works)<br>
</div><div><br></div><div>* FindFunctions (works but then GetContextAtIndex(0).GetLineEntry is invalid)<br></div><div>* I also tried using ResolveFileAddress but that didn't work; not sure if it's because I need to set the load address somehow.</div>
<div><br></div><div>Note that all the above work when calling a separate process.</div><div><br></div><div>Is there some example code snippet for doing that?</div><div><br></div></div>