Replace `ObjectLinkingLayer::Plugin::notifyMaterializing`.
This method was introduced in ef2389235c5de to support ELF debugging, but it's very special purpose and not otherwise a good fit for the ObjectLinkingLayer::Plugin interface. We should replace it with a special section, .jitlink.original_object_content (or something like that), which could be created by the ELFLinkGraphBuilder. The debug plugins could then detect this section and use it to copy out the debug content.
@llvm/issue-subscribers-orcjit
Author: Lang Hames (lhames)
request to be assigned this issue :)
request to be assigned this issue :)
Done! :)
Just to clarify the method notifyMaterializing in ObjectLinkingLayer.cpp would be replaced by a method/section added to ELFLinkGraphBuilder.h? (and of course replace all calls to it as part of ObjectLinkingLayer to change the functionality to be a part of ELFLinkGraphBuilder?)
@sonar3d That's right. The only Plugin to implement notifyMaterializing is DebugObjectManagerPlugin, and that could be updated to look for a special section in the LinkGraph instead (it should do this by inserting a PrePrunePass to inspect the graph).
@sonar3d That's right. The only Plugin to implement
notifyMaterializingisDebugObjectManagerPlugin, and that could be updated to look for a special section in theLinkGraphinstead (it should do this by inserting aPrePrunePassto inspect the graph).
What would be a good way to check the functionality is still working?
@sonar3d That's right. The only Plugin to implement
notifyMaterializingisDebugObjectManagerPlugin, and that could be updated to look for a special section in theLinkGraphinstead (it should do this by inserting aPrePrunePassto inspect the graph).What would be a good way to check the functionality is still working?
I would try out the following example: https://github.com/llvm/llvm-project/blob/main/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp
If you're building on Linux it's already available as a target: ninja LLJITWithRemoteDebugging.
If the example still builds and runs as expected then your changes are all good. :)
If you're building on Darwin then you'll want to test this in a Linux docker container -- just let me know and I'll send the commands that I use to set mine up.