[examples] Call setProcessAllSections to ensure debug sections aren't droppped.
authorLang Hames <lhames@gmail.com>
Thu, 30 Apr 2020 23:08:25 +0000 (16:08 -0700)
committerLang Hames <lhames@gmail.com>
Fri, 1 May 2020 18:06:41 +0000 (11:06 -0700)
Calling setProcessAllSections(true) is required to make sure that all sections,
even those not marked as necessary for execution, are passed to the memory
manager.

llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp

index 5cf7cd0..493d121 100644 (file)
@@ -69,8 +69,14 @@ int main(int argc, char *argv[]) {
                       auto ObjLinkingLayer =
                           std::make_unique<RTDyldObjectLinkingLayer>(
                               ES, std::move(GetMemMgr));
+
+                      // Register the event listener.
                       ObjLinkingLayer->registerJITEventListener(
                           *JITEventListener::createGDBRegistrationListener());
+
+                      // Make sure the debug info sections aren't stripped.
+                      ObjLinkingLayer->setProcessAllSections(true);
+
                       return ObjLinkingLayer;
                     })
                     .create());