summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp')
-rw-r--r--llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
index e792b7257ea..69d70e94808 100644
--- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -367,6 +367,8 @@ static int printLineInfoForInput(bool LoadObjects, bool UseDebugObj) {
}
uint64_t Addr = *AddrOrErr;
+ object::SectionedAddress Address;
+
uint64_t Size = P.second;
// If we're not using the debug object, compute the address of the
// symbol in memory (rather than that in the unrelocated object file)
@@ -381,16 +383,20 @@ static int printLineInfoForInput(bool LoadObjects, bool UseDebugObj) {
object::section_iterator Sec = *SecOrErr;
StringRef SecName;
Sec->getName(SecName);
+ Address.SectionIndex = Sec->getIndex();
uint64_t SectionLoadAddress =
LoadedObjInfo->getSectionLoadAddress(*Sec);
if (SectionLoadAddress != 0)
Addr += SectionLoadAddress - Sec->getAddress();
- }
+ } else if (auto SecOrErr = Sym.getSection())
+ Address.SectionIndex = SecOrErr.get()->getIndex();
outs() << "Function: " << *Name << ", Size = " << Size
<< ", Addr = " << Addr << "\n";
- DILineInfoTable Lines = Context->getLineInfoForAddressRange(Addr, Size);
+ Address.Address = Addr;
+ DILineInfoTable Lines =
+ Context->getLineInfoForAddressRange(Address, Size);
for (auto &D : Lines) {
outs() << " Line info @ " << D.first - Addr << ": "
<< D.second.FileName << ", line:" << D.second.Line << "\n";
OpenPOWER on IntegriCloud