savi
savi copied to clipboard
Enable lldb workflow that steps through LLVM IR instead of Savi/C source code
When working on the compiler or troubleshooting a problem, it can sometimes be more useful to step through the LLVM Intermediate Representation as if it were source code, instead of stepping through the actual high-level Savi (or C, if in the runtime) source code.
I have in the past looked for an existing LLVM feature that supports this, but was disappointed to find that it did not exist.
However, this morning I stumbled upon the fact that this used to be (until 2014) a standard pass in LLVM you could enable, called the DebugIR
pass, but at some point it was removed. A little more recently (in 2017) there was an attempt to try to bring it back, but it stalled.
It would be great to try to bring this feature into Savi - if nothing else, then by copying the source code from that LLVM patch directly into our project and building it as a pass ourselves. We'd also need to emit the relevant .ll
file to disk so that it could be referred to in the debug info in a way that was reachable by the debugger (lldb or gdb).