summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/C13DebugFragmentVisitor.h
blob: f0a536c6adca27c0d8ba2468cc2e4ed4c6c02187 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//===- C13DebugFragmentVisitor.h - Visitor for CodeView Info ----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TOOLS_LLVMPDBDUMP_C13DEBUGFRAGMENTVISITOR_H
#define LLVM_TOOLS_LLVMPDBDUMP_C13DEBUGFRAGMENTVISITOR_H

#include "llvm/ADT/Optional.h"
#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentVisitor.h"
#include "llvm/Support/Error.h"

#include <vector>

namespace llvm {

namespace pdb {

class PDBFile;

class C13DebugFragmentVisitor : public codeview::ModuleDebugFragmentVisitor {
public:
  C13DebugFragmentVisitor(PDBFile &F);
  ~C13DebugFragmentVisitor();

  Error visitUnknown(codeview::ModuleDebugUnknownFragmentRef &Fragment) final;

  Error visitFileChecksums(
      codeview::ModuleDebugFileChecksumFragmentRef &Checksums) final;

  Error visitLines(codeview::ModuleDebugLineFragmentRef &Lines) final;

  Error finished() final;

protected:
  virtual Error handleFileChecksums() { return Error::success(); }
  virtual Error handleLines() { return Error::success(); }

  Expected<StringRef> getNameFromStringTable(uint32_t Offset);
  Expected<StringRef> getNameFromChecksumsBuffer(uint32_t Offset);

  Optional<codeview::ModuleDebugFileChecksumFragmentRef> Checksums;
  std::vector<codeview::ModuleDebugLineFragmentRef> Lines;

  PDBFile &F;
};
}
}

#endif
OpenPOWER on IntegriCloud