[CMake] Allow overriding MSVC_DIA_SDK_DIR via CMake
[llvm-core.git] / tools / llvm-readobj / Win64EHDumper.h
blob97458c916bec6f589bebaef3805b72549ca89f92
1 //===- Win64EHDumper.h - Win64 EH Printing ----------------------*- 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_LLVM_READOBJ_WIN64EHDUMPER_H
10 #define LLVM_TOOLS_LLVM_READOBJ_WIN64EHDUMPER_H
12 #include "llvm/Support/ScopedPrinter.h"
13 #include "llvm/Support/Win64EH.h"
15 namespace llvm {
16 namespace object {
17 class COFFObjectFile;
18 class SymbolRef;
19 struct coff_section;
22 namespace Win64EH {
23 class Dumper {
24 ScopedPrinter &SW;
25 raw_ostream &OS;
27 public:
28 typedef std::error_code (*SymbolResolver)(const object::coff_section *,
29 uint64_t, object::SymbolRef &,
30 void *);
32 struct Context {
33 const object::COFFObjectFile &COFF;
34 SymbolResolver ResolveSymbol;
35 void *UserData;
37 Context(const object::COFFObjectFile &COFF, SymbolResolver Resolver,
38 void *UserData)
39 : COFF(COFF), ResolveSymbol(Resolver), UserData(UserData) {}
42 private:
43 void printRuntimeFunctionEntry(const Context &Ctx,
44 const object::coff_section *Section,
45 uint64_t SectionOffset,
46 const RuntimeFunction &RF);
47 void printUnwindCode(const UnwindInfo& UI, ArrayRef<UnwindCode> UC);
48 void printUnwindInfo(const Context &Ctx, const object::coff_section *Section,
49 off_t Offset, const UnwindInfo &UI);
50 void printRuntimeFunction(const Context &Ctx,
51 const object::coff_section *Section,
52 uint64_t SectionOffset, const RuntimeFunction &RF);
54 public:
55 Dumper(ScopedPrinter &SW) : SW(SW), OS(SW.getOStream()) {}
57 void printData(const Context &Ctx);
62 #endif