From e27a787760ea7c2899da3287002fe8ba316df0d0 Mon Sep 17 00:00:00 2001 From: Andrew Kaylor Date: Sat, 26 Jan 2013 00:28:05 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173537 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-rtdyld/llvm-rtdyld.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools/llvm-rtdyld') diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp index 8b71a4f364..4d8d345894 100644 --- a/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/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"; + } } } } -- cgit v1.2.3