[PATCH] D59189: [perf][DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"

Sylvestre Ledru via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 10:52:50 PDT 2019


sylvestre.ledru updated this revision to Diff 190454.
sylvestre.ledru added a comment.

Remove an unrelated change


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59189/new/

https://reviews.llvm.org/D59189

Files:
  lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp


Index: lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
===================================================================
--- lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
+++ lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
@@ -265,16 +265,22 @@
       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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59189.190454.patch
Type: text/x-patch
Size: 1193 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190313/ae65a61b/attachment.bin>


More information about the llvm-commits mailing list