[llvm-dev] Reviving the DebugIR pass

Dan Liew via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 23 06:54:49 PDT 2018


On 22 March 2018 at 00:37, Jason Surprise <thesurprises at gmail.com> wrote:
> We have implemented a debug pass to enable debugging of jitted functions.
> The pass dumps the IR of the module at the beginning of the pass, which then
> becomes the source code for the debug metadata. Our solution focuses on a
> windows x86 solution but I’m sure it would be easy to extend to other
> platforms.
>
> In order to load the resulting debugging info into Visual Studio, we jit to
> object file then offline use msvc linker to create a dll with debugging
> symbols. We then load the dll into the running executable. At that point
> most debugging facilities are available, such as setting breakpoints,
> stepping through IR or assembly, etc.
>
> With our workflow we jit a substantial amount of functionality and having
> the ability to debug IR has been very useful.  I could work on making this
> open source if there is interest.

Thanks for offering. I suspect that open sourcing this may take quite
some time. So the approach I'd like to take is to revive the existing
patch and add you as a reviewer with the goal of the getting the
functionality usable for your use case.
Of course if you think the pass can be upstreamed in a timely manner
I'd happily reconsider.

The other parts you mention sound like they belong as part of the JIT
itself. Given that I don't really work with LLVM's JIT I don't know
how useful it would be to have that support upstream (although it does
sound very useful to me).

Dan.


More information about the llvm-dev mailing list