Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
//===- ModuleDebugStream.h - PDB Module Info Stream Access ------*- 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
//===----------------------------------------------------------------------===//
8
 
9
#ifndef LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
10
#define LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
11
 
12
#include "llvm/ADT/iterator_range.h"
13
#include "llvm/DebugInfo/CodeView/CVRecord.h"
14
#include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
15
#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
16
#include "llvm/Support/BinaryStreamRef.h"
17
#include "llvm/Support/Error.h"
18
#include <cstdint>
19
#include <memory>
20
 
21
namespace llvm {
22
class BinaryStreamReader;
23
namespace codeview {
24
class DebugChecksumsSubsectionRef;
25
}
26
namespace msf {
27
class MappedBlockStream;
28
}
29
namespace pdb {
30
 
31
class ModuleDebugStreamRef {
32
  using DebugSubsectionIterator = codeview::DebugSubsectionArray::Iterator;
33
 
34
public:
35
  ModuleDebugStreamRef(const DbiModuleDescriptor &Module,
36
                       std::unique_ptr<msf::MappedBlockStream> Stream);
37
  ModuleDebugStreamRef(ModuleDebugStreamRef &&Other) = default;
38
  ModuleDebugStreamRef(const ModuleDebugStreamRef &Other) = default;
39
  ~ModuleDebugStreamRef();
40
 
41
  Error reload();
42
 
43
  uint32_t signature() const { return Signature; }
44
 
45
  iterator_range<codeview::CVSymbolArray::Iterator>
46
  symbols(bool *HadError) const;
47
 
48
  const codeview::CVSymbolArray &getSymbolArray() const { return SymbolArray; }
49
  const codeview::CVSymbolArray
50
  getSymbolArrayForScope(uint32_t ScopeBegin) const;
51
 
52
  BinarySubstreamRef getSymbolsSubstream() const;
53
  BinarySubstreamRef getC11LinesSubstream() const;
54
  BinarySubstreamRef getC13LinesSubstream() const;
55
  BinarySubstreamRef getGlobalRefsSubstream() const;
56
 
57
  ModuleDebugStreamRef &operator=(ModuleDebugStreamRef &&Other) = delete;
58
 
59
  codeview::CVSymbol readSymbolAtOffset(uint32_t Offset) const;
60
 
61
  iterator_range<DebugSubsectionIterator> subsections() const;
62
  codeview::DebugSubsectionArray getSubsectionsArray() const {
63
    return Subsections;
64
  }
65
 
66
  bool hasDebugSubsections() const;
67
 
68
  Error commit();
69
 
70
  Expected<codeview::DebugChecksumsSubsectionRef>
71
  findChecksumsSubsection() const;
72
 
73
private:
74
  Error reloadSerialize(BinaryStreamReader &Reader);
75
 
76
  DbiModuleDescriptor Mod;
77
 
78
  uint32_t Signature;
79
 
80
  std::shared_ptr<msf::MappedBlockStream> Stream;
81
 
82
  codeview::CVSymbolArray SymbolArray;
83
 
84
  BinarySubstreamRef SymbolsSubstream;
85
  BinarySubstreamRef C11LinesSubstream;
86
  BinarySubstreamRef C13LinesSubstream;
87
  BinarySubstreamRef GlobalRefsSubstream;
88
 
89
  codeview::DebugSubsectionArray Subsections;
90
};
91
 
92
} // end namespace pdb
93
} // end namespace llvm
94
 
95
#endif // LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H