JIT debugging and Windows

Hello,

We have a project which uses MCJIT to compile code from our KL language with Dwarf debugging info and we’re now working on debugger support under Linux and Windows. We have a basic prototype working under both and at this point we’re thinking it may make sense to integrate what we have into LLDB since there are still areas that we need to address that are already addressed in the existing LLDB implementation.

My question is around two items, namely JIT support and Windows support in LLDB. We would first be looking to target LLDB debugging of MCJIT-ted code under Linux and then adding support for Windows. The LLDB site seems to indicate that JIT support is underway and I would be happy to contribute to this effort. If it’s stalled we could take it up ourselves, I notice a post on the list from a couple of years back which could possibly be used as a starting point?

The LLDB site also indicates that Windows support is underway, we’d also be interested in contributing to this and knowing anything about its current status. It’s unclear whether the current plans include implementing support for the Windows debugging API as we would require. We could push on this area as well once we have a Linux JIT debugger up and running.

Thanks,

Andrew

Hi Andrew,

I've been lurking on this list for months, hoping to see a message like this
one. It really is Christmas :slight_smile:

Over at the Julia project (http://julialang.org/), we're in need of a good
debugger. Is your project in a public repository? If so, would you be willing
to point to a branch or series of commits that shows how far along you are?

I agree it would be great to see LLDB support this use case.

Best,
--Tim

Hi Tim,

At the moment the debugger work is integrated with our closed KL compiler (http://fabricengine.com/) so I can’t point you to a public repository right now, though we’d like to move this functionality to LLDB.

As a bit of an overview we currently have a simple debugger written using ptrace on Linux and the Debug API on Windows. The debugger receives info from MCJIT’s GDBRegistrar in the same way as GDB when code has been JIT-ed and we then parse the Dwarf info from that object (using the elftoolchain). We support breakpoints and examining variables on both OSes but it’s become clear that as we push on we’re duplicating effort with the LLDB project so it would be nice to bring them together.

There are a few issues on Windows, such as the fact that we’re currently mixing VS-compiled code in our core engine with the MCJIT-ed ELF+Dwarf but at least initially we are only aiming for debuggability of the MCJIT-generated code there. There are probably other issues that we’ll discover as well, hence the desire to open it up to other interested parties. :slight_smile:

If you guys have made any progress it’d be great to coordinate, I imagine things will be quiet over the next week or so but we should be picking up on this in early January.

Cheers,
Andrew