1 //===- MinimalSymbolDumper.h ---------------------------------- *- C++ --*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_SYMBOL_DUMPER_H
10 #define LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_SYMBOL_DUMPER_H
12 #include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
16 class LazyRandomTypeCollection
;
23 class MinimalSymbolDumper
: public codeview::SymbolVisitorCallbacks
{
25 MinimalSymbolDumper(LinePrinter
&P
, bool RecordBytes
,
26 codeview::LazyRandomTypeCollection
&Ids
,
27 codeview::LazyRandomTypeCollection
&Types
)
28 : P(P
), RecordBytes(RecordBytes
), Ids(Ids
), Types(Types
) {}
29 MinimalSymbolDumper(LinePrinter
&P
, bool RecordBytes
,
30 const SymbolGroup
&SymGroup
,
31 codeview::LazyRandomTypeCollection
&Ids
,
32 codeview::LazyRandomTypeCollection
&Types
)
33 : P(P
), RecordBytes(RecordBytes
), SymGroup(&SymGroup
), Ids(Ids
),
36 Error
visitSymbolBegin(codeview::CVSymbol
&Record
) override
;
37 Error
visitSymbolBegin(codeview::CVSymbol
&Record
, uint32_t Offset
) override
;
38 Error
visitSymbolEnd(codeview::CVSymbol
&Record
) override
;
40 void setSymbolGroup(const SymbolGroup
*Group
) { SymGroup
= Group
; }
42 #define SYMBOL_RECORD(EnumName, EnumVal, Name) \
43 virtual Error visitKnownRecord(codeview::CVSymbol &CVR, \
44 codeview::Name &Record) override;
45 #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
46 #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
49 std::string
typeOrIdIndex(codeview::TypeIndex TI
, bool IsType
) const;
51 std::string
typeIndex(codeview::TypeIndex TI
) const;
52 std::string
idIndex(codeview::TypeIndex TI
) const;
56 /// Dumping certain records requires knowing what machine this is. The
57 /// S_COMPILE3 record will tell us, but if we don't see one, default to X64.
58 codeview::CPUType CompilationCPU
= codeview::CPUType::X64
;
61 const SymbolGroup
*SymGroup
= nullptr;
62 codeview::LazyRandomTypeCollection
&Ids
;
63 codeview::LazyRandomTypeCollection
&Types
;