[PATCH] D59490: [DebugInfo] IntelJitEventListener follow up for "add SectionedAddress to DebugInfo interfaces"

Brock Wyma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 06:49:16 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL356895 (authored by bwyma, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59490?vs=191306&id=192095#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D59490

Files:
  llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp


Index: llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
===================================================================
--- llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
+++ llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
@@ -141,15 +141,25 @@
     uint64_t Addr = *AddrOrErr;
     uint64_t Size = P.second;
 
+    auto SecOrErr = Sym.getSection();
+    if (!SecOrErr) {
+      // TODO: Actually report errors helpfully.
+      consumeError(SecOrErr.takeError());
+      continue;
+    }
+    object::section_iterator Sec = *SecOrErr;
+    if (Sec == Obj.section_end())
+      continue;
+    uint64_t Index = Sec->getIndex();
+
     // Record this address in a local vector
     Functions.push_back((void*)Addr);
 
     // Build the function loaded notification message
     iJIT_Method_Load FunctionMessage =
       FunctionDescToIntelJITFormat(*Wrapper, Name->data(), Addr, Size);
-    // TODO: it is neccessary to set proper SectionIndex here.
-    // object::SectionedAddress::UndefSection works for only absolute addresses.
-    DILineInfoTable Lines = Context->getLineInfoForAddressRange({Addr, object::SectionedAddress::UndefSection}, Size);
+    DILineInfoTable Lines =
+      Context->getLineInfoForAddressRange({Addr, Index}, Size);
     DILineInfoTable::iterator Begin = Lines.begin();
     DILineInfoTable::iterator End = Lines.end();
     for (DILineInfoTable::iterator It = Begin; It != End; ++It) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59490.192095.patch
Type: text/x-patch
Size: 1491 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190325/eb8f0c3f/attachment.bin>


More information about the llvm-commits mailing list