summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFDebugRangeList.h
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-09-04 08:12:33 +0000
committerAlexey Samsonov <samsonov@google.com>2012-09-04 08:12:33 +0000
commit5eae90d727c64ca5b4b43b110521b38dcd9f0de6 (patch)
treeb932b5a23ada1047a06817c055c1e97a469f39a9 /lib/DebugInfo/DWARFDebugRangeList.h
parent2d5c28da0d14883cd0cd6fcf38d7e28040b634c0 (diff)
downloadllvm-5eae90d727c64ca5b4b43b110521b38dcd9f0de6.tar.gz
llvm-5eae90d727c64ca5b4b43b110521b38dcd9f0de6.tar.bz2
llvm-5eae90d727c64ca5b4b43b110521b38dcd9f0de6.tar.xz
Add support for fetching inlining context (stack of source code locations)
by instruction address from DWARF. Add --inlining flag to llvm-dwarfdump to demonstrate and test this functionality, so that "llvm-dwarfdump --inlining --address=0x..." now works much like "addr2line -i 0x...", provided that the binary has debug info (Clang's -gline-tables-only *is* enough). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFDebugRangeList.h')
-rw-r--r--lib/DebugInfo/DWARFDebugRangeList.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARFDebugRangeList.h b/lib/DebugInfo/DWARFDebugRangeList.h
index b8d334f7ba..4e34a916f4 100644
--- a/lib/DebugInfo/DWARFDebugRangeList.h
+++ b/lib/DebugInfo/DWARFDebugRangeList.h
@@ -31,6 +31,29 @@ public:
// address past the end of the address range. The ending address must
// be greater than or equal to the beginning address.
uint64_t EndAddress;
+ // The end of any given range list is marked by an end of list entry,
+ // which consists of a 0 for the beginning address offset
+ // and a 0 for the ending address offset.
+ bool isEndOfListEntry() const {
+ return (StartAddress == 0) && (EndAddress == 0);
+ }
+ // A base address selection entry consists of:
+ // 1. The value of the largest representable address offset
+ // (for example, 0xffffffff when the size of an address is 32 bits).
+ // 2. An address, which defines the appropriate base address for
+ // use in interpreting the beginning and ending address offsets of
+ // subsequent entries of the location list.
+ bool isBaseAddressSelectionEntry(uint8_t AddressSize) const {
+ assert(AddressSize == 4 || AddressSize == 8);
+ if (AddressSize == 4)
+ return StartAddress == -1U;
+ else
+ return StartAddress == -1ULL;
+ }
+ bool containsAddress(uint64_t BaseAddress, uint64_t Address) const {
+ return (BaseAddress + StartAddress <= Address) &&
+ (Address < BaseAddress + EndAddress);
+ }
};
private:
@@ -44,6 +67,10 @@ public:
void clear();
void dump(raw_ostream &OS) const;
bool extract(DataExtractor data, uint32_t *offset_ptr);
+ /// containsAddress - Returns true if range list contains the given
+ /// address. Has to be passed base address of the compile unit that
+ /// references this range list.
+ bool containsAddress(uint64_t BaseAddress, uint64_t Address) const;
};
} // namespace llvm