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

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 03:57:50 PDT 2019


avl added a comment.

Thanks for fixing this! Please check comments.



================
Comment at: lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp:145
+    auto SecOrErr = Sym.getSection();
+    if (!SecOrErr) {
+      // TODO: Actually report errors helpfully.
----------------
AFAIU there should not be error here. If Sym is an absolute symbol without section assigned then Undef value should be used as SectionIndex.


================
Comment at: lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp:150
+    }
+    object::section_iterator Sec = *SecOrErr;
+    uint64_t Index = Sec->getIndex();
----------------
It is neccessary to check iterator for Obj.section_end() here. Something like this : 

uint64_t SectionIndex = object::SectionedAddress::UndefSection;
if (auto SectOrErr = Sym.getSection())
  if (*SectOrErr != Obj.section_end())
    SectionIndex = SectOrErr.get()->getIndex();

DILineInfoTable Lines = Context->getLineInfoForAddressRange(
    {*AddrOrErr, SectionIndex}, Size, FileLineInfoKind::AbsoluteFilePath);


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

https://reviews.llvm.org/D59490





More information about the llvm-commits mailing list