[llvm-commits] [PATCH] Review request - MCJIT GDB source level debugging support

Kaylor, Andrew andrew.kaylor at intel.com
Thu Apr 12 18:40:13 PDT 2012


The attached patch implements GDB integration for source-level debugging of code JITed using the MCJIT execution engine.

The GDB JIT debugging integration support works by registering a "loaded" object image with a pre-defined function that GDB will monitor if GDB is attached.  I have only implemented GDB integration support for ELF, but I think it should be possible to add MachO support if anyone is interested in doing so.  This integration requires GDB version 7.0 or newer.

To get GDB to correctly recognize the registered image, the addresses in code and data section headers needed to be updated to reflect the address at which these sections were loaded into process memory.  This required the introduction of a level of abstraction that lets me create a subclass of ELFObjectFile to update the section headers in the object file image emitted by the code generator.  I am using a new abstraction class, ObjectImage, to continue to allow the format-independent code to be abstracted, while providing a convenient place to introduce the new ELFObjectFile subclass and adding methods to update section and symbol addresses during the loading process.  The default implementation of ObjectImage aggregates ObjectFile and provides empty stubs for the update functions so that it behaves exactly as ObjectFile did in the code revision on which my changes are based.

Thanks in advance for your reviews and feedback.

-Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120413/4a5c70d0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GDB_Integration.patch
Type: application/octet-stream
Size: 30290 bytes
Desc: GDB_Integration.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120413/4a5c70d0/attachment.obj>


More information about the llvm-commits mailing list