diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-08-07 11:46:57 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-08-07 11:46:57 +0000 |
commit | 351f83be64057380877615153fe5dc50308ab017 (patch) | |
tree | 64f4a82adea27798422027ccf6f6fa6ad5a35b10 /lib/DebugInfo/DWARFContext.cpp | |
parent | b6fdd022b7414f916ba7b08560a0f55e14863326 (diff) | |
download | external_llvm-351f83be64057380877615153fe5dc50308ab017.zip external_llvm-351f83be64057380877615153fe5dc50308ab017.tar.gz external_llvm-351f83be64057380877615153fe5dc50308ab017.tar.bz2 |
Fix the representation of debug line table in DebugInfo LLVM library,
and "instruction address -> file/line" lookup.
Instead of plain collection of rows, debug line table for compilation unit is now
treated as the number of row ranges, describing sequences (series of contiguous machine
instructions). The sequences are not always listed in the order of increasing
address, so previously used std::lower_bound() sometimes produced wrong results.
Now the instruction address lookup consists of two stages: finding the correct
sequence, and searching for address in range of rows for this sequence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFContext.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index a4e0d8e..797662b 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -167,9 +167,7 @@ DILineInfo DWARFContext::getLineInfoForAddress(uint64_t address, const DWARFDebugLine::LineTable *lineTable = getLineTableForCompileUnit(cu); if (lineTable) { // Get the index of the row we're looking for in the line table. - uint64_t hiPC = cu->getCompileUnitDIE()->getAttributeValueAsUnsigned( - cu, DW_AT_high_pc, -1ULL); - uint32_t rowIndex = lineTable->lookupAddress(address, hiPC); + uint32_t rowIndex = lineTable->lookupAddress(address); if (rowIndex != -1U) { const DWARFDebugLine::Row &row = lineTable->Rows[rowIndex]; // Take file/line info from the line table. |