diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-25 01:44:02 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-25 01:44:02 +0000 |
commit | 9c550ac4e79b20a4e78fc99ec6b57bc62cf502b0 (patch) | |
tree | 0024de59c32f3d80596332f3227b800d6adffe74 /llvm/lib/DebugInfo/DWARFDebugLoc.h | |
parent | 2d33d6a4c29fcda36cc13591c9a007498934c961 (diff) | |
download | bcm5719-llvm-9c550ac4e79b20a4e78fc99ec6b57bc62cf502b0.tar.gz bcm5719-llvm-9c550ac4e79b20a4e78fc99ec6b57bc62cf502b0.zip |
DebugInfo: Support debug_loc under fission
Implement debug_loc.dwo, as well as llvm-dwarfdump support for dumping
this section.
Outlined in the DWARF5 spec and http://gcc.gnu.org/wiki/DebugFission the
debug_loc.dwo section has more variation than the standard debug_loc,
allowing 3 different forms of entry (plus the end of list entry). GCC
seems to, and Clang certainly, only use one form, so I've just
implemented dumping support for that for now.
It wasn't immediately obvious that there was a good refactoring to share
the implementation of dumping support between debug_loc and
debug_loc.dwo, so they're separate for now - ideas welcome or I may come
back to it at some point.
As per a comment in the code, we could choose different forms that may
reduce the number of debug_addr entries we emit, but that will require
further study.
llvm-svn: 204697
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugLoc.h')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFDebugLoc.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugLoc.h b/llvm/lib/DebugInfo/DWARFDebugLoc.h index d31aaaa1273..663acbb42f8 100644 --- a/llvm/lib/DebugInfo/DWARFDebugLoc.h +++ b/llvm/lib/DebugInfo/DWARFDebugLoc.h @@ -55,6 +55,27 @@ public: /// specified address size to interpret the address ranges. void parse(DataExtractor data, unsigned AddressSize); }; + +class DWARFDebugLocDWO { + struct Entry { + uint64_t Start; + uint32_t Length; + SmallVector<unsigned char, 4> Loc; + }; + + struct LocationList { + unsigned Offset; + SmallVector<Entry, 2> Entries; + }; + + typedef SmallVector<LocationList, 4> LocationLists; + + LocationLists Locations; + +public: + void parse(DataExtractor data); + void dump(raw_ostream &OS) const; +}; } #endif |