diff options
author | Zachary Turner <zturner@google.com> | 2015-03-02 04:39:56 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-03-02 04:39:56 +0000 |
commit | 7797c726b9a864372553de4b640c540b1dae8251 (patch) | |
tree | 655a6b62386ef5b43759a072b66b3d588fea3ba1 /llvm/tools/llvm-pdbdump/VariableDumper.cpp | |
parent | 968ceddca9a80197db8c785faf80fa9fc44ef7cd (diff) | |
download | bcm5719-llvm-7797c726b9a864372553de4b640c540b1dae8251.tar.gz bcm5719-llvm-7797c726b9a864372553de4b640c540b1dae8251.zip |
[llvm-pdbdump] Many minor fixes and improvements
A short list of some of the improvements:
1) Now supports -all command line argument, which implies many
other command line arguments to simplify usage.
2) Now supports -no-compiler-generated command line argument to
exclude compiler generated types.
3) Prints base class list.
4) -class-definitions implies -types.
5) Proper display of bitfields.
6) Can now distinguish between struct/class/interface/union.
And a few other minor tweaks.
llvm-svn: 230933
Diffstat (limited to 'llvm/tools/llvm-pdbdump/VariableDumper.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbdump/VariableDumper.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/tools/llvm-pdbdump/VariableDumper.cpp b/llvm/tools/llvm-pdbdump/VariableDumper.cpp index d520fd10099..a46e1b0c4e9 100644 --- a/llvm/tools/llvm-pdbdump/VariableDumper.cpp +++ b/llvm/tools/llvm-pdbdump/VariableDumper.cpp @@ -31,6 +31,8 @@ VariableDumper::VariableDumper(LinePrinter &P) : PDBSymDumper(true), Printer(P) {} void VariableDumper::start(const PDBSymbolData &Var) { + if (Var.isCompilerGenerated() && opts::ExcludeCompilerGenerated) + return; if (Printer.IsSymbolExcluded(Var.getName())) return; @@ -41,23 +43,31 @@ void VariableDumper::start(const PDBSymbolData &Var) { switch (auto LocType = Var.getLocationType()) { case PDB_LocType::Static: + Printer << "["; WithColor(Printer, PDB_ColorItem::Address).get() - << "[" << format_hex(Var.getRelativeVirtualAddress(), 10) << "] "; + << format_hex(Var.getRelativeVirtualAddress(), 10); + Printer << "] "; WithColor(Printer, PDB_ColorItem::Keyword).get() << "static "; dumpSymbolTypeAndName(*VarType, Var.getName()); break; case PDB_LocType::Constant: WithColor(Printer, PDB_ColorItem::Keyword).get() << "const "; dumpSymbolTypeAndName(*VarType, Var.getName()); - Printer << "["; + Printer << " = "; WithColor(Printer, PDB_ColorItem::LiteralValue).get() << Var.getValue(); - Printer << "]"; break; case PDB_LocType::ThisRel: WithColor(Printer, PDB_ColorItem::Offset).get() << "+" << format_hex(Var.getOffset(), 4) << " "; dumpSymbolTypeAndName(*VarType, Var.getName()); break; + case PDB_LocType::BitField: + WithColor(Printer, PDB_ColorItem::Offset).get() + << "+" << format_hex(Var.getOffset(), 4) << " "; + dumpSymbolTypeAndName(*VarType, Var.getName()); + Printer << " : "; + WithColor(Printer, PDB_ColorItem::LiteralValue).get() << Var.getLength(); + break; default: Printer << "unknown(" << LocType << ") "; WithColor(Printer, PDB_ColorItem::Identifier).get() << Var.getName(); |