summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrock Wyma <brock.wyma@intel.com>2019-03-25 13:50:26 +0000
committerBrock Wyma <brock.wyma@intel.com>2019-03-25 13:50:26 +0000
commitbc92c8c8636b78507123faa6e9ef71b3f8f48d08 (patch)
tree5c2ad4ee1ce9e3804ec09f9691f3aa241ceffb79
parent3c488d7eb3464a9274e4b36e1b75ccdea577d5c7 (diff)
downloadbcm5719-llvm-bc92c8c8636b78507123faa6e9ef71b3f8f48d08.tar.gz
bcm5719-llvm-bc92c8c8636b78507123faa6e9ef71b3f8f48d08.zip
[DebugInfo] IntelJitEventListener follow up for "add SectionedAddress ..."
Following r354972 the Intel JIT Listener would not report line table information because the section indices did not match. There was a similar issue with the PerfJitEventListener. This change performs the section index lookup when building the object address used to query the line table information. Differential Revision: https://reviews.llvm.org/D59490 llvm-svn: 356895
-rw-r--r--llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp b/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
index 2b89f9d16fa..1ebc820a8b4 100644
--- a/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
+++ b/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
@@ -141,15 +141,25 @@ void IntelJITEventListener::notifyObjectLoaded(
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) {
OpenPOWER on IntegriCloud