2017-06-16 00:24:24 +02:00
|
|
|
//===- RawOutputStyle.h -------------------------------------- *- C++ --*-===//
|
2016-06-03 21:28:33 +02:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-06-16 00:24:24 +02:00
|
|
|
#ifndef LLVM_TOOLS_LLVMPDBDUMP_RAWOUTPUTSTYLE_H
|
|
|
|
#define LLVM_TOOLS_LLVMPDBDUMP_RAWOUTPUTSTYLE_H
|
2016-06-03 21:28:33 +02:00
|
|
|
|
2017-06-16 00:24:24 +02:00
|
|
|
#include "LinePrinter.h"
|
2016-06-03 21:28:33 +02:00
|
|
|
#include "OutputStyle.h"
|
|
|
|
|
2017-05-05 01:53:01 +02:00
|
|
|
#include "llvm/ADT/Optional.h"
|
2017-03-14 00:28:25 +01:00
|
|
|
#include "llvm/ADT/SmallVector.h"
|
[CodeView] Finish decoupling TypeDatabase from TypeDumper.
Previously the type dumper itself was passed around to a lot of different
places and manipulated in ways that were more appropriate on the type
database. For example, the entire TypeDumper was passed into the symbol
dumper, when all the symbol dumper wanted to do was lookup the name of a
TypeIndex so it could print it. That's what the TypeDatabase is for --
mapping type indices to names.
Another example is how if the user runs llvm-pdbdump with the option to
dump symbols but not types, we still have to visit all types so that we
can print minimal information about the type of a symbol, but just without
dumping full symbol records. The way we did this before is by hacking it
up so that we run everything through the type dumper with a null printer,
so that the output goes to /dev/null. But really, we don't need to dump
anything, all we want to do is build the type database. Since
TypeDatabaseVisitor now exists independently of TypeDumper, we can do
this. We just build a custom visitor callback pipeline that includes a
database visitor but not a dumper.
All the hackery around printers etc goes away. After this patch, we could
probably even delete the entire CVTypeDumper class since really all it is
at this point is a thin wrapper that hides the details of how to build a
useful visitation pipeline. It's not a priority though, so CVTypeDumper
remains for now.
After this patch we will be able to easily plug in a different style of
type dumper by only implementing the proper visitation methods to dump
one-line output and then sticking it on the pipeline.
Differential Revision: https://reviews.llvm.org/D28524
llvm-svn: 291724
2017-01-12 00:24:22 +01:00
|
|
|
#include "llvm/DebugInfo/CodeView/TypeDatabase.h"
|
2016-06-03 21:28:33 +02:00
|
|
|
|
2017-03-14 00:28:25 +01:00
|
|
|
#include <string>
|
|
|
|
|
2016-06-03 21:28:33 +02:00
|
|
|
namespace llvm {
|
2016-08-01 23:19:45 +02:00
|
|
|
class BitVector;
|
2017-05-19 21:26:58 +02:00
|
|
|
|
|
|
|
namespace codeview {
|
|
|
|
class LazyRandomTypeCollection;
|
|
|
|
}
|
|
|
|
|
2016-06-03 21:28:33 +02:00
|
|
|
namespace pdb {
|
2017-06-16 00:24:24 +02:00
|
|
|
class RawOutputStyle : public OutputStyle {
|
2016-06-03 21:28:33 +02:00
|
|
|
public:
|
2017-06-16 00:24:24 +02:00
|
|
|
RawOutputStyle(PDBFile &File);
|
2016-06-03 21:28:33 +02:00
|
|
|
|
2016-06-30 19:42:48 +02:00
|
|
|
Error dump() override;
|
2016-06-06 22:37:05 +02:00
|
|
|
|
2016-06-03 21:28:33 +02:00
|
|
|
private:
|
2017-05-19 21:26:58 +02:00
|
|
|
Expected<codeview::LazyRandomTypeCollection &>
|
|
|
|
initializeTypeDatabase(uint32_t SN);
|
2017-05-05 01:53:01 +02:00
|
|
|
|
2017-06-16 00:24:24 +02:00
|
|
|
Error dumpFileSummary();
|
2016-06-30 19:42:48 +02:00
|
|
|
Error dumpStreamSummary();
|
2016-09-09 20:17:52 +02:00
|
|
|
Error dumpBlockRanges();
|
|
|
|
Error dumpStreamBytes();
|
2017-01-20 23:42:09 +01:00
|
|
|
Error dumpStringTable();
|
2017-06-16 01:56:19 +02:00
|
|
|
Error dumpLines();
|
|
|
|
Error dumpInlineeLines();
|
2017-06-16 02:04:24 +02:00
|
|
|
Error dumpXmi();
|
|
|
|
Error dumpXme();
|
2016-06-30 19:42:48 +02:00
|
|
|
Error dumpTpiStream(uint32_t StreamIdx);
|
2017-06-16 00:24:24 +02:00
|
|
|
Error dumpModules();
|
2017-06-16 01:12:41 +02:00
|
|
|
Error dumpModuleFiles();
|
2017-06-16 00:24:24 +02:00
|
|
|
Error dumpModuleSyms();
|
|
|
|
Error dumpPublics();
|
2016-06-30 19:42:48 +02:00
|
|
|
Error dumpSectionContribs();
|
|
|
|
Error dumpSectionMap();
|
|
|
|
|
2016-06-03 21:28:33 +02:00
|
|
|
PDBFile &File;
|
2017-06-16 00:24:24 +02:00
|
|
|
LinePrinter P;
|
2017-05-19 21:26:58 +02:00
|
|
|
std::unique_ptr<codeview::LazyRandomTypeCollection> TpiTypes;
|
|
|
|
std::unique_ptr<codeview::LazyRandomTypeCollection> IpiTypes;
|
2017-03-14 00:28:25 +01:00
|
|
|
SmallVector<std::string, 32> StreamPurposes;
|
2016-06-03 21:28:33 +02:00
|
|
|
};
|
2017-06-16 00:24:24 +02:00
|
|
|
} // namespace pdb
|
|
|
|
} // namespace llvm
|
2016-06-03 21:28:33 +02:00
|
|
|
|
|
|
|
#endif
|