From 30b28766d62dc2800e2e203017b2f9625eb9df0b Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 30 Apr 2020 16:08:25 -0700 Subject: [PATCH] [examples] Call setProcessAllSections to ensure debug sections aren't droppped. 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. --- .../LLJITWithGDBRegistrationListener.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp b/llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp index 5cf7cd0..493d121 100644 --- a/llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp +++ b/llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener/LLJITWithGDBRegistrationListener.cpp @@ -69,8 +69,14 @@ int main(int argc, char *argv[]) { auto ObjLinkingLayer = std::make_unique( 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()); -- 2.7.4