From: Lang Hames Date: Thu, 30 Apr 2020 23:08:25 +0000 (-0700) Subject: [examples] Call setProcessAllSections to ensure debug sections aren't droppped. X-Git-Tag: llvmorg-12-init~7206 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30b28766d62dc2800e2e203017b2f9625eb9df0b;p=platform%2Fupstream%2Fllvm.git [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. --- 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());