summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbutil/DumpOutputStyle.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-09-01 20:06:56 +0000
committerZachary Turner <zturner@google.com>2017-09-01 20:06:56 +0000
commitabb17cc084d917a54b3e5021bbb3ecdfc1a49d23 (patch)
tree2ceb0b03a84f9954158397e0222afba212cf9227 /llvm/tools/llvm-pdbutil/DumpOutputStyle.h
parentc36039f462a8270a69b64309810f537e4991bb1c (diff)
downloadbcm5719-llvm-abb17cc084d917a54b3e5021bbb3ecdfc1a49d23.tar.gz
bcm5719-llvm-abb17cc084d917a54b3e5021bbb3ecdfc1a49d23.zip
[llvm-pdbutil] Support dumping CodeView from object files.
We have llvm-readobj for dumping CodeView from object files, and llvm-pdbutil has always been more focused on PDB. However, llvm-pdbutil has a lot of useful options for summarizing debug information in aggregate and presenting high level statistical views. Furthermore, it's arguably better as a testing tool since we don't have to write tests to conform to a state-machine like structure where you match multiple lines in succession, each depending on a previous match. llvm-pdbutil dumps much more concisely, so it's possible to use single-line matches in many cases where as with readobj tests you have to use multi-line matches with an implicit state machine. Because of this, I'm adding object file support to llvm-pdbutil. In fact, this mirrors the cvdump tool from Microsoft, which also supports both object files and pdb files. In the future we could perhaps rename this tool llvm-cvutil. In the meantime, this allows us to deep dive into object files the same way we already can with PDB files. llvm-svn: 312358
Diffstat (limited to 'llvm/tools/llvm-pdbutil/DumpOutputStyle.h')
-rw-r--r--llvm/tools/llvm-pdbutil/DumpOutputStyle.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.h b/llvm/tools/llvm-pdbutil/DumpOutputStyle.h
index 7dd717c3788..85598307863 100644
--- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.h
+++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.h
@@ -28,8 +28,13 @@ namespace codeview {
class LazyRandomTypeCollection;
}
+namespace object {
+class COFFObjectFile;
+}
+
namespace pdb {
class GSIHashTable;
+class InputFile;
struct StatCollection {
struct Stat {
@@ -57,12 +62,13 @@ struct StatCollection {
class DumpOutputStyle : public OutputStyle {
public:
- DumpOutputStyle(PDBFile &File);
+ DumpOutputStyle(InputFile &File);
Error dump() override;
private:
- Expected<codeview::LazyRandomTypeCollection &> initializeTypes(uint32_t SN);
+ PDBFile &getPdb();
+ object::COFFObjectFile &getObj();
Error dumpFileSummary();
Error dumpStreamSummary();
@@ -76,7 +82,8 @@ private:
Error dumpTpiStream(uint32_t StreamIdx);
Error dumpModules();
Error dumpModuleFiles();
- Error dumpModuleSyms();
+ Error dumpModuleSymsForPdb();
+ Error dumpModuleSymsForObj();
Error dumpGlobals();
Error dumpPublics();
Error dumpSymbolsFromGSI(const GSIHashTable &Table, bool HashExtras);
@@ -86,10 +93,8 @@ private:
void dumpSectionHeaders(StringRef Label, DbgHeaderType Type);
- PDBFile &File;
+ InputFile &File;
LinePrinter P;
- std::unique_ptr<codeview::LazyRandomTypeCollection> TpiTypes;
- std::unique_ptr<codeview::LazyRandomTypeCollection> IpiTypes;
SmallVector<StreamInfo, 32> StreamPurposes;
};
} // namespace pdb
OpenPOWER on IntegriCloud