1 //===- DebugFrameDataSubsection.h ------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H
11 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H
13 #include "llvm/DebugInfo/CodeView/CodeView.h"
14 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
15 #include "llvm/Support/BinaryStreamReader.h"
16 #include "llvm/Support/Endian.h"
17 #include "llvm/Support/Error.h"
21 class DebugFrameDataSubsectionRef final : public DebugSubsectionRef {
23 DebugFrameDataSubsectionRef()
24 : DebugSubsectionRef(DebugSubsectionKind::FrameData) {}
25 static bool classof(const DebugSubsection *S) {
26 return S->kind() == DebugSubsectionKind::FrameData;
29 Error initialize(BinaryStreamReader Reader);
30 Error initialize(BinaryStreamRef Stream);
32 FixedStreamArray<FrameData>::Iterator begin() const { return Frames.begin(); }
33 FixedStreamArray<FrameData>::Iterator end() const { return Frames.end(); }
35 const support::ulittle32_t *getRelocPtr() const { return RelocPtr; }
38 const support::ulittle32_t *RelocPtr = nullptr;
39 FixedStreamArray<FrameData> Frames;
42 class DebugFrameDataSubsection final : public DebugSubsection {
44 DebugFrameDataSubsection(bool IncludeRelocPtr)
45 : DebugSubsection(DebugSubsectionKind::FrameData),
46 IncludeRelocPtr(IncludeRelocPtr) {}
47 static bool classof(const DebugSubsection *S) {
48 return S->kind() == DebugSubsectionKind::FrameData;
51 uint32_t calculateSerializedSize() const override;
52 Error commit(BinaryStreamWriter &Writer) const override;
54 void addFrameData(const FrameData &Frame);
55 void setFrames(ArrayRef<FrameData> Frames);
58 bool IncludeRelocPtr = false;
59 std::vector<FrameData> Frames;