<div dir="ltr"><div>Hi everyone,</div><div><br></div><div>I'm working on a library for runtime introspection of C++ programs, for example, getting stack traces, decorating logs with source file information, etc. It currently uses LLVMObject and LLVMDebugInfo.</div><div><br></div><div>There's a feature I want to add, but it requires that I understand where on the stack local variables are located.</div><div><br></div><div>For this to work on x86-64, I would need to do whole "virtual unwinding" thing, i.e., create a library that can understand the DWARF call frame information. This is something that I do not want to do myself, because I would never have the resources to maintain it. LLVM and or LLDB must have code for doing this already though.</div><div><br></div><div>In fact, since this sort of dynamic inspection is kind of like debugging, I originally thought LLDB would work better in the first place. I actually tried early on to use LLDB, but I gave up quickly. The API seems to be designed so that you must always attach one process to another, using an operating system facility like ptrace.</div><div><br></div><div>That is not really compatible with the idea of the program inspecting _itself_, although I think there is definitely a place for that, e.g. portable stack traces, source info without the need for __FILE__ and __LINE__ boilerplate, etc.</div><div><br></div><div>Does LLDB support anything like this, and I just didn't find it? Or going another route, is there any plan for the DWARF classes in LLVMDebugInfo to ever support APIs for understanding the call frame info?</div><div><br></div><div>If neither, any advice on what I should do?</div><div><br></div><div>Thanks!</div><div>Ken</div></div>