[PATCH] D58959: [DebugInfo][ExecutionEngine] follow up for "add SectionedAddress to DebugInfo interfaces"

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 04:18:42 PST 2019


avl created this revision.
avl added a reviewer: dblaikie.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

[ExecutionEngine] The https://reviews.llvm.org/D58194 patch changed symbolizer interface.
Particularily it requires not only Address but SectionIndex also. This patch set proper SectionIndex
 instead of Undefined value. That cures several lit tests for ExecutionEngine.


https://reviews.llvm.org/D58959

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


Index: llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
===================================================================
--- llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
+++ llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
@@ -147,9 +147,13 @@
     // 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);
+
+    uint64_t SectionIndex = object::SectionedAddress::UndefSection;
+    if (auto SectOrErr = Sym.getSection())
+      SectionIndex = SectOrErr.get()->getIndex();
+
+    DILineInfoTable Lines =
+        Context->getLineInfoForAddressRange({Addr, SectionIndex}, 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: D58959.189296.patch
Type: text/x-patch
Size: 1178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190305/8040384c/attachment.bin>


More information about the llvm-commits mailing list