]> granicus.if.org Git - llvm/commitdiff
[perf][DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"
authorSylvestre Ledru <sylvestre@debian.org>
Wed, 20 Mar 2019 10:02:18 +0000 (10:02 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Wed, 20 Mar 2019 10:02:18 +0000 (10:02 +0000)
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

lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp

index 892a10782ae8dec41d8ab7887dcb9a1ff073b22b..67c3887cc495aab21fc384e949956491e23c3bae 100644 (file)
@@ -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();