[PATCH] Debugging LLVM IR with LLDB (and gdb)

Malea, Daniel daniel.malea at intel.com
Mon Apr 15 09:15:00 PDT 2013


On 2013-04-13 12:26 PM, "Duncan Sands" <baldrick at free.fr> wrote:

>
>Maybe you could cheat, and nest the IR scope inside a fake lexical block
>scope that has the file and line number from the original source.  Dunno
>if this would actually allow you to find the original from the debugger...
>
>Ciao, Duncan.
>

Thanks Duncan for the tips. I'm not sure if this would work unless the
debugger has the ability to open two "source" files at once. Currently,
neither GDB or LLDB have this feature, AFAIK.

Another thought I had was to read the original source code by opening
original source file during the pass and embed them in the IR as
comments.. It would be a terrible hack, but the end result would be that
users could see both IR and original source in the debugger, much like
some disassemblers embed original source lines between assembly
instructions. 


Dan





More information about the llvm-commits mailing list