blob: 383007b84c5fae594059948faa0cf99b485900a3 [file] [log] [blame]
Zachary Turnerea40f402018-03-29 16:28:20 +00001//===- ExplainOutputStyle.h ----------------------------------- *- C++ --*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_TOOLS_LLVMPDBDUMP_EXPLAINOUTPUTSTYLE_H
11#define LLVM_TOOLS_LLVMPDBDUMP_EXPLAINOUTPUTSTYLE_H
12
13#include "LinePrinter.h"
14#include "OutputStyle.h"
15
16#include <string>
17
18namespace llvm {
19
20namespace pdb {
21
Zachary Turnerd5cf5cf2018-03-30 17:16:50 +000022class DbiStream;
Zachary Turnerea40f402018-03-29 16:28:20 +000023class PDBFile;
24
25class ExplainOutputStyle : public OutputStyle {
26
27public:
28 ExplainOutputStyle(PDBFile &File, uint64_t FileOffset);
29
30 Error dump() override;
31
32private:
33 bool explainBlockStatus();
34
35 bool isFpm1() const;
36 bool isFpm2() const;
37
38 bool isSuperBlock() const;
39 bool isFpmBlock() const;
40 bool isBlockMapBlock() const;
41 bool isStreamDirectoryBlock() const;
42 Optional<uint32_t> getBlockStreamIndex() const;
43
44 void explainSuperBlockOffset();
45 void explainFpmBlockOffset();
46 void explainBlockMapOffset();
47 void explainStreamDirectoryOffset();
48 void explainStreamOffset(uint32_t Stream);
49 void explainUnknownBlock();
50
Zachary Turnerd5cf5cf2018-03-30 17:16:50 +000051 void explainDbiStream(uint32_t StreamIdx, uint32_t OffsetInStream);
52 void explainPdbStream(uint32_t StreamIdx, uint32_t OffsetInStream);
53
Zachary Turnerea40f402018-03-29 16:28:20 +000054 PDBFile &File;
55 const uint64_t FileOffset;
56 const uint64_t BlockIndex;
57 const uint64_t OffsetInBlock;
58 LinePrinter P;
59};
60} // namespace pdb
61} // namespace llvm
62
63#endif