[LLVMdev] debugging LLVM-JITted code
Eli Bendersky
eliben at gmail.com
Tue Aug 30 03:47:45 PDT 2011
Hello,
I'm interested in debugging code JITted by LLVM at runtime. For that, I
should naturally have some way to emit DWARF that faithfully describes the
JITted code into memory along with the JITted code itself and point the
debugger to it. Let's assume that the bridge with the debugger is taken care
of (e.g. http://llvm.org/docs/DebuggingJITedCode.html) - my concern in this
question is solely with the LLVM side.
AFAIU, LLVM currently includes very partial support for emitting DWARF info
with JIT, in the JITDwarfEmitter class. What it has is just a way to emit
stack frame information (symbols and DWARF CFA), to allow meaningful core
dumps from JITted code, with stack information. This is useful, but
obviously very far from full debugging support.
So where should I look for adding such support? Is MC JIT the direction?
Does it purport to emit DWARF as well as executable code? Any pointers to
relevant places in the code would be most appreciated.
Note: I'm aware there's an alternative approach - generating a "true" shared
lib with LLVM's toolchain dynamically and loading it. It has its pros and
cons vs. generating DWARF directly with the JITted code, and in this
question I'm focusing on the latter.
Thanks in advance,
Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110830/1b554a6a/attachment.html>
More information about the llvm-dev
mailing list