2017-06-23 04:57:39 +08:00
|
|
|
//===- DumpOutputStyle.h -------------------------------------- *- C++ --*-===//
|
2016-06-04 03:28:33 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-06-23 04:57:39 +08:00
|
|
|
#ifndef LLVM_TOOLS_LLVMPDBDUMP_DUMPOUTPUTSTYLE_H
|
|
|
|
#define LLVM_TOOLS_LLVMPDBDUMP_DUMPOUTPUTSTYLE_H
|
2016-06-04 03:28:33 +08:00
|
|
|
|
2017-06-16 06:24:24 +08:00
|
|
|
#include "LinePrinter.h"
|
2016-06-04 03:28:33 +08:00
|
|
|
#include "OutputStyle.h"
|
2017-08-21 22:53:25 +08:00
|
|
|
#include "StreamUtil.h"
|
2016-06-04 03:28:33 +08:00
|
|
|
|
2017-08-21 22:53:25 +08:00
|
|
|
#include "llvm/ADT/DenseMap.h"
|
2017-05-05 07:53:01 +08:00
|
|
|
#include "llvm/ADT/Optional.h"
|
2017-03-14 07:28:25 +08:00
|
|
|
#include "llvm/ADT/SmallVector.h"
|
2017-08-05 04:02:38 +08:00
|
|
|
#include "llvm/DebugInfo/PDB/Native/RawConstants.h"
|
2016-06-04 03:28:33 +08:00
|
|
|
|
2017-03-14 07:28:25 +08:00
|
|
|
#include <string>
|
|
|
|
|
2016-06-04 03:28:33 +08:00
|
|
|
namespace llvm {
|
2016-08-02 05:19:45 +08:00
|
|
|
class BitVector;
|
2017-05-20 03:26:58 +08:00
|
|
|
|
|
|
|
namespace codeview {
|
|
|
|
class LazyRandomTypeCollection;
|
|
|
|
}
|
|
|
|
|
2017-09-02 04:06:56 +08:00
|
|
|
namespace object {
|
|
|
|
class COFFObjectFile;
|
|
|
|
}
|
|
|
|
|
2016-06-04 03:28:33 +08:00
|
|
|
namespace pdb {
|
2017-07-26 08:40:36 +08:00
|
|
|
class GSIHashTable;
|
2017-09-02 04:06:56 +08:00
|
|
|
class InputFile;
|
2017-07-26 08:40:36 +08:00
|
|
|
|
2017-08-21 22:53:25 +08:00
|
|
|
struct StatCollection {
|
|
|
|
struct Stat {
|
|
|
|
Stat() {}
|
|
|
|
Stat(uint32_t Count, uint32_t Size) : Count(Count), Size(Size) {}
|
|
|
|
uint32_t Count = 0;
|
|
|
|
uint32_t Size = 0;
|
|
|
|
|
|
|
|
void update(uint32_t RecordSize) {
|
|
|
|
++Count;
|
|
|
|
Size += RecordSize;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void update(uint32_t Kind, uint32_t RecordSize) {
|
|
|
|
Totals.update(RecordSize);
|
|
|
|
auto Iter = Individual.try_emplace(Kind, 1, RecordSize);
|
|
|
|
if (!Iter.second)
|
|
|
|
Iter.first->second.update(RecordSize);
|
|
|
|
}
|
|
|
|
Stat Totals;
|
|
|
|
DenseMap<uint32_t, Stat> Individual;
|
|
|
|
};
|
|
|
|
|
2017-06-23 04:57:39 +08:00
|
|
|
class DumpOutputStyle : public OutputStyle {
|
2017-08-21 22:53:25 +08:00
|
|
|
|
2016-06-04 03:28:33 +08:00
|
|
|
public:
|
2017-09-02 04:06:56 +08:00
|
|
|
DumpOutputStyle(InputFile &File);
|
2016-06-04 03:28:33 +08:00
|
|
|
|
2016-07-01 01:42:48 +08:00
|
|
|
Error dump() override;
|
2016-06-07 04:37:05 +08:00
|
|
|
|
2016-06-04 03:28:33 +08:00
|
|
|
private:
|
2017-09-02 04:06:56 +08:00
|
|
|
PDBFile &getPdb();
|
|
|
|
object::COFFObjectFile &getObj();
|
2017-05-05 07:53:01 +08:00
|
|
|
|
2017-06-16 06:24:24 +08:00
|
|
|
Error dumpFileSummary();
|
2016-07-01 01:42:48 +08:00
|
|
|
Error dumpStreamSummary();
|
2017-09-01 04:43:22 +08:00
|
|
|
Error dumpSymbolStats();
|
|
|
|
Error dumpUdtStats();
|
2017-01-21 06:42:09 +08:00
|
|
|
Error dumpStringTable();
|
2017-06-16 07:56:19 +08:00
|
|
|
Error dumpLines();
|
|
|
|
Error dumpInlineeLines();
|
2017-06-16 08:04:24 +08:00
|
|
|
Error dumpXmi();
|
|
|
|
Error dumpXme();
|
2016-07-01 01:42:48 +08:00
|
|
|
Error dumpTpiStream(uint32_t StreamIdx);
|
2017-06-16 06:24:24 +08:00
|
|
|
Error dumpModules();
|
2017-06-16 07:12:41 +08:00
|
|
|
Error dumpModuleFiles();
|
2017-09-02 04:06:56 +08:00
|
|
|
Error dumpModuleSymsForPdb();
|
|
|
|
Error dumpModuleSymsForObj();
|
2017-07-26 08:40:36 +08:00
|
|
|
Error dumpGlobals();
|
2017-06-16 06:24:24 +08:00
|
|
|
Error dumpPublics();
|
2017-07-26 08:40:36 +08:00
|
|
|
Error dumpSymbolsFromGSI(const GSIHashTable &Table, bool HashExtras);
|
2017-08-05 04:02:38 +08:00
|
|
|
Error dumpSectionHeaders();
|
2016-07-01 01:42:48 +08:00
|
|
|
Error dumpSectionContribs();
|
|
|
|
Error dumpSectionMap();
|
|
|
|
|
2017-08-05 04:02:38 +08:00
|
|
|
void dumpSectionHeaders(StringRef Label, DbgHeaderType Type);
|
|
|
|
|
2017-09-02 04:06:56 +08:00
|
|
|
InputFile &File;
|
2017-06-16 06:24:24 +08:00
|
|
|
LinePrinter P;
|
2017-08-21 22:53:25 +08:00
|
|
|
SmallVector<StreamInfo, 32> StreamPurposes;
|
2016-06-04 03:28:33 +08:00
|
|
|
};
|
2017-06-16 06:24:24 +08:00
|
|
|
} // namespace pdb
|
|
|
|
} // namespace llvm
|
2016-06-04 03:28:33 +08:00
|
|
|
|
|
|
|
#endif
|