Improve llvm-pdbdump output display.

This patch adds a number of improvements to llvm-pdbdump.

1) Dumping of the entire global scope, and not only those
   symbols that live in individual compilands.
2) Prepend class name to member functions and data
3) Improved display of bitfields.
4) Support for dumping more kinds of data symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229012 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner
2015-02-13 01:23:51 +00:00
parent 1c092c03ba
commit bcaafc81ab
10 changed files with 299 additions and 41 deletions

View File

@@ -97,6 +97,7 @@ public:
std::string getUndecoratedName() const override;
uint32_t getUnmodifiedTypeId() const override;
uint32_t getUpperBoundId() const override;
Variant getValue() const override;
uint32_t getVirtualBaseDispIndex() const override;
uint32_t getVirtualBaseOffset() const override;
uint32_t getVirtualTableShapeId() const override;
@@ -193,6 +194,8 @@ public:
bool isVirtualBaseClass() const override;
bool isVirtualInheritance() const override;
bool isVolatileType() const override;
bool wasInlined() const override;
std::string getUnused() const override;
private:
const DIASession &Session;

View File

@@ -106,6 +106,7 @@ public:
virtual std::string getUndecoratedName() const = 0;
virtual uint32_t getUnmodifiedTypeId() const = 0;
virtual uint32_t getUpperBoundId() const = 0;
virtual Variant getValue() const = 0;
virtual uint32_t getVirtualBaseDispIndex() const = 0;
virtual uint32_t getVirtualBaseOffset() const = 0;
virtual uint32_t getVirtualTableShapeId() const = 0;
@@ -202,6 +203,8 @@ public:
virtual bool isVirtualBaseClass() const = 0;
virtual bool isVirtualInheritance() const = 0;
virtual bool isVolatileType() const = 0;
virtual bool wasInlined() const = 0;
virtual std::string getUnused() const = 0;
};
} // namespace llvm

View File

@@ -25,6 +25,8 @@ struct stream_indent {
};
raw_ostream &operator<<(raw_ostream &OS, const stream_indent &Indent);
raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
raw_ostream &operator<<(raw_ostream &OS, const PDB_RegisterId &Reg);
raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
raw_ostream &operator<<(raw_ostream &OS, const PDB_ThunkOrdinal &Thunk);
@@ -32,6 +34,8 @@ raw_ostream &operator<<(raw_ostream &OS, const PDB_Checksum &Checksum);
raw_ostream &operator<<(raw_ostream &OS, const PDB_Lang &Lang);
raw_ostream &operator<<(raw_ostream &OS, const PDB_SymType &Tag);
raw_ostream &operator<<(raw_ostream &OS, const PDB_UniqueId &Id);
raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);
raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
}

View File

@@ -49,7 +49,7 @@ public:
FORWARD_SYMBOL_METHOD(getToken)
FORWARD_SYMBOL_METHOD(getTypeId)
FORWARD_SYMBOL_METHOD(isUnalignedType)
// FORWARD_SYMBOL_METHOD(getValue)
FORWARD_SYMBOL_METHOD(getValue)
FORWARD_SYMBOL_METHOD(getVirtualAddress)
FORWARD_SYMBOL_METHOD(isVolatileType)
};

View File

@@ -433,6 +433,44 @@ struct VersionInfo {
uint32_t QFE;
};
enum PDB_VariantType {
Empty,
Unknown,
Int8,
Int16,
Int32,
Int64,
Single,
Double,
UInt8,
UInt16,
UInt32,
UInt64,
Bool,
};
struct Variant {
Variant()
: Type(PDB_VariantType::Empty) {
}
PDB_VariantType Type;
union {
bool Bool;
int8_t Int8;
int16_t Int16;
int32_t Int32;
int64_t Int64;
float Single;
double Double;
uint8_t UInt8;
uint16_t UInt16;
uint32_t UInt32;
uint64_t UInt64;
void* Pointer;
};
};
} // namespace llvm
namespace std {