diff options
author | Frederic Riss <friss@apple.com> | 2015-02-25 21:30:09 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2015-02-25 21:30:09 +0000 |
commit | baf195f7eb2a199edf54478709c0323b1b8394e2 (patch) | |
tree | 3b5170f109e2919f399a3daf7db5aaf3a721a734 /llvm/lib/DebugInfo | |
parent | ae70ec88ae503d6fa162378f39566899029d8b9f (diff) | |
download | bcm5719-llvm-baf195f7eb2a199edf54478709c0323b1b8394e2.tar.gz bcm5719-llvm-baf195f7eb2a199edf54478709c0323b1b8394e2.zip |
DWARFDebugFrame: Actually collect CIEs associated with FDEs.
This is the first commit in a small series aiming at making
debug_frame dump more useful (right now it prints a list of
opeartions without their operands).
llvm-svn: 230547
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp index b7a0dd34290..b757fb0308a 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp @@ -246,10 +246,11 @@ public: // an offset to the CIE (provided by parsing the FDE header). The CIE itself // is obtained lazily once it's actually required. FDE(uint64_t Offset, uint64_t Length, int64_t LinkedCIEOffset, - uint64_t InitialLocation, uint64_t AddressRange) + uint64_t InitialLocation, uint64_t AddressRange, + CIE *Cie) : FrameEntry(FK_FDE, Offset, Length), LinkedCIEOffset(LinkedCIEOffset), InitialLocation(InitialLocation), AddressRange(AddressRange), - LinkedCIE(nullptr) {} + LinkedCIE(Cie) {} ~FDE() { } @@ -299,6 +300,7 @@ static void LLVM_ATTRIBUTE_UNUSED dumpDataAux(DataExtractor Data, void DWARFDebugFrame::parse(DataExtractor Data) { uint32_t Offset = 0; + DenseMap<uint32_t, CIE *> CIEs; while (Data.isValidOffset(Offset)) { uint32_t StartOffset = Offset; @@ -338,9 +340,11 @@ void DWARFDebugFrame::parse(DataExtractor Data) { int64_t DataAlignmentFactor = Data.getSLEB128(&Offset); uint64_t ReturnAddressRegister = Data.getULEB128(&Offset); - Entries.emplace_back(new CIE(StartOffset, Length, Version, - StringRef(Augmentation), CodeAlignmentFactor, - DataAlignmentFactor, ReturnAddressRegister)); + auto Cie = make_unique<CIE>(StartOffset, Length, Version, + StringRef(Augmentation), CodeAlignmentFactor, + DataAlignmentFactor, ReturnAddressRegister); + CIEs[StartOffset] = Cie.get(); + Entries.emplace_back(std::move(Cie)); } else { // FDE uint64_t CIEPointer = Id; @@ -348,7 +352,8 @@ void DWARFDebugFrame::parse(DataExtractor Data) { uint64_t AddressRange = Data.getAddress(&Offset); Entries.emplace_back(new FDE(StartOffset, Length, CIEPointer, - InitialLocation, AddressRange)); + InitialLocation, AddressRange, + CIEs[CIEPointer])); } Entries.back()->parseInstructions(Data, &Offset, EndStructureOffset); |