summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2013-01-26 00:28:05 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2013-01-26 00:28:05 +0000
commit9a8ff813f34b39438b8042a6d784a4f2305b9fcc (patch)
tree0842a314e5a6ca3e10b8a9f58b464824c8ea18c6 /llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
parent201d7b2545f112cd5774e803011ac9b0edfb40d3 (diff)
downloadbcm5719-llvm-9a8ff813f34b39438b8042a6d784a4f2305b9fcc.tar.gz
bcm5719-llvm-9a8ff813f34b39438b8042a6d784a4f2305b9fcc.zip
Add DIContext::getLineInfoForAddressRange() function and test. This function allows a caller to obtain a table of line information for a function using the function's address and size.
llvm-svn: 173537
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 8b71a4f3641..4d8d345894d 100644
--- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -163,8 +163,14 @@ static int printLineInfoForInput() {
outs() << "Function: " << Name << ", Size = " << Size << "\n";
- DILineInfo Result = Context->getLineInfoForAddress(Addr);
- outs() << " Line info:" << Result.getFileName() << ", line:" << Result.getLine() << "\n";
+ DILineInfoTable Lines = Context->getLineInfoForAddressRange(Addr, Size);
+ DILineInfoTable::iterator Begin = Lines.begin();
+ DILineInfoTable::iterator End = Lines.end();
+ for (DILineInfoTable::iterator It = Begin; It != End; ++It) {
+ outs() << " Line info @ " << It->first - Addr << ": "
+ << It->second.getFileName()
+ << ", line:" << It->second.getLine() << "\n";
+ }
}
}
}
OpenPOWER on IntegriCloud