From: Sylvestre Ledru Date: Wed, 20 Mar 2019 10:02:18 +0000 (+0000) Subject: [perf][DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces" X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5720ca7ac6c01a9420131e18f2823b82bb465c6;p=llvm [perf][DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces" Summary: Fix the build failure when perf jit is enabled Reviewers: avl, dblaikie Reviewed By: avl Subscribers: modocache, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59189 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356542 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp b/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp index 892a10782ae..67c3887cc49 100644 --- a/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp +++ b/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp @@ -265,16 +265,22 @@ void PerfJITEventListener::notifyObjectLoaded( consumeError(AddrOrErr.takeError()); continue; } - uint64_t Addr = *AddrOrErr; uint64_t Size = P.second; + object::SectionedAddress Address; + Address.Address = *AddrOrErr; + + uint64_t SectionIndex = object::SectionedAddress::UndefSection; + if (auto SectOrErr = Sym.getSection()) + if (*SectOrErr != Obj.section_end()) + SectionIndex = SectOrErr.get()->getIndex(); // According to spec debugging info has to come before loading the // corresonding code load. DILineInfoTable Lines = Context->getLineInfoForAddressRange( - Addr, Size, FileLineInfoKind::AbsoluteFilePath); + {*AddrOrErr, SectionIndex}, Size, FileLineInfoKind::AbsoluteFilePath); - NotifyDebug(Addr, Lines); - NotifyCode(Name, Addr, Size); + NotifyDebug(*AddrOrErr, Lines); + NotifyCode(Name, *AddrOrErr, Size); } Dumpstream->flush();