[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG...
[llvm-complete.git] / tools / llvm-pdbutil / ExplainOutputStyle.h
blobf405cf615e924580432a14e4cc12a2fe4bbd38c2
1 //===- ExplainOutputStyle.h ----------------------------------- *- C++ --*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVMPDBDUMP_EXPLAINOUTPUTSTYLE_H
10 #define LLVM_TOOLS_LLVMPDBDUMP_EXPLAINOUTPUTSTYLE_H
12 #include "LinePrinter.h"
13 #include "OutputStyle.h"
15 #include <string>
17 namespace llvm {
19 namespace pdb {
21 class DbiStream;
22 class InfoStream;
23 class InputFile;
25 class ExplainOutputStyle : public OutputStyle {
27 public:
28 ExplainOutputStyle(InputFile &File, uint64_t FileOffset);
30 Error dump() override;
32 private:
33 Error explainPdbFile();
34 Error explainBinaryFile();
36 bool explainPdbBlockStatus();
38 bool isPdbFpm1() const;
39 bool isPdbFpm2() const;
41 bool isPdbSuperBlock() const;
42 bool isPdbFpmBlock() const;
43 bool isPdbBlockMapBlock() const;
44 bool isPdbStreamDirectoryBlock() const;
45 Optional<uint32_t> getPdbBlockStreamIndex() const;
47 void explainPdbSuperBlockOffset();
48 void explainPdbFpmBlockOffset();
49 void explainPdbBlockMapOffset();
50 void explainPdbStreamDirectoryOffset();
51 void explainPdbStreamOffset(uint32_t Stream);
52 void explainPdbUnknownBlock();
54 void explainStreamOffset(DbiStream &Stream, uint32_t OffsetInStream);
55 void explainStreamOffset(InfoStream &Stream, uint32_t OffsetInStream);
57 uint32_t pdbBlockIndex() const;
58 uint32_t pdbBlockOffset() const;
60 InputFile &File;
61 const uint64_t FileOffset;
62 LinePrinter P;
64 } // namespace pdb
65 } // namespace llvm
67 #endif