2017-06-16 00:24:24 +02:00
|
|
|
//===- MinimalSymbolDumper.h ---------------------------------- *- C++ --*-===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-06-16 00:24:24 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_SYMBOL_DUMPER_H
|
|
|
|
#define LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_SYMBOL_DUMPER_H
|
|
|
|
|
|
|
|
#include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace codeview {
|
|
|
|
class LazyRandomTypeCollection;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace pdb {
|
|
|
|
class LinePrinter;
|
2018-01-05 20:12:40 +01:00
|
|
|
class SymbolGroup;
|
2017-06-16 00:24:24 +02:00
|
|
|
|
|
|
|
class MinimalSymbolDumper : public codeview::SymbolVisitorCallbacks {
|
|
|
|
public:
|
|
|
|
MinimalSymbolDumper(LinePrinter &P, bool RecordBytes,
|
2017-08-08 20:34:44 +02:00
|
|
|
codeview::LazyRandomTypeCollection &Ids,
|
2017-06-16 00:24:24 +02:00
|
|
|
codeview::LazyRandomTypeCollection &Types)
|
2017-08-17 22:04:31 +02:00
|
|
|
: P(P), RecordBytes(RecordBytes), Ids(Ids), Types(Types) {}
|
2018-01-05 20:12:40 +01:00
|
|
|
MinimalSymbolDumper(LinePrinter &P, bool RecordBytes,
|
|
|
|
const SymbolGroup &SymGroup,
|
|
|
|
codeview::LazyRandomTypeCollection &Ids,
|
|
|
|
codeview::LazyRandomTypeCollection &Types)
|
|
|
|
: P(P), RecordBytes(RecordBytes), SymGroup(&SymGroup), Ids(Ids),
|
|
|
|
Types(Types) {}
|
2017-06-16 00:24:24 +02:00
|
|
|
|
|
|
|
Error visitSymbolBegin(codeview::CVSymbol &Record) override;
|
2017-06-30 23:35:00 +02:00
|
|
|
Error visitSymbolBegin(codeview::CVSymbol &Record, uint32_t Offset) override;
|
2017-06-16 00:24:24 +02:00
|
|
|
Error visitSymbolEnd(codeview::CVSymbol &Record) override;
|
|
|
|
|
2018-01-05 20:12:40 +01:00
|
|
|
void setSymbolGroup(const SymbolGroup *Group) { SymGroup = Group; }
|
|
|
|
|
2017-06-16 00:24:24 +02:00
|
|
|
#define SYMBOL_RECORD(EnumName, EnumVal, Name) \
|
|
|
|
virtual Error visitKnownRecord(codeview::CVSymbol &CVR, \
|
|
|
|
codeview::Name &Record) override;
|
|
|
|
#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
|
|
|
|
#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
|
|
|
|
|
|
|
|
private:
|
2017-08-08 20:34:44 +02:00
|
|
|
std::string typeOrIdIndex(codeview::TypeIndex TI, bool IsType) const;
|
|
|
|
|
2017-06-16 00:24:24 +02:00
|
|
|
std::string typeIndex(codeview::TypeIndex TI) const;
|
2017-08-08 20:34:44 +02:00
|
|
|
std::string idIndex(codeview::TypeIndex TI) const;
|
2017-06-16 00:24:24 +02:00
|
|
|
|
|
|
|
LinePrinter &P;
|
2018-09-12 00:00:50 +02:00
|
|
|
|
|
|
|
/// Dumping certain records requires knowing what machine this is. The
|
|
|
|
/// S_COMPILE3 record will tell us, but if we don't see one, default to X64.
|
|
|
|
codeview::CPUType CompilationCPU = codeview::CPUType::X64;
|
|
|
|
|
2017-08-17 22:04:31 +02:00
|
|
|
bool RecordBytes;
|
2018-01-05 20:12:40 +01:00
|
|
|
const SymbolGroup *SymGroup = nullptr;
|
2017-08-08 20:34:44 +02:00
|
|
|
codeview::LazyRandomTypeCollection &Ids;
|
2017-06-16 00:24:24 +02:00
|
|
|
codeview::LazyRandomTypeCollection &Types;
|
|
|
|
};
|
|
|
|
} // namespace pdb
|
|
|
|
} // namespace llvm
|
|
|
|
|
2018-09-12 00:00:50 +02:00
|
|
|
#endif
|