diff options
Diffstat (limited to 'llvm/tools/llvm-pdbdump/PrettyVariableDumper.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbdump/PrettyVariableDumper.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/llvm/tools/llvm-pdbdump/PrettyVariableDumper.cpp b/llvm/tools/llvm-pdbdump/PrettyVariableDumper.cpp index ef9a9b51bd0..76a0d23bf87 100644 --- a/llvm/tools/llvm-pdbdump/PrettyVariableDumper.cpp +++ b/llvm/tools/llvm-pdbdump/PrettyVariableDumper.cpp @@ -35,7 +35,7 @@ using namespace llvm::pdb; VariableDumper::VariableDumper(LinePrinter &P) : PDBSymDumper(true), Printer(P) {} -void VariableDumper::start(const PDBSymbolData &Var) { +void VariableDumper::start(const PDBSymbolData &Var, uint32_t Offset) { if (Var.isCompilerGenerated() && opts::pretty::ExcludeCompilerGenerated) return; if (Printer.IsSymbolExcluded(Var.getName())) @@ -68,16 +68,16 @@ void VariableDumper::start(const PDBSymbolData &Var) { Printer.NewLine(); Printer << "data "; WithColor(Printer, PDB_ColorItem::Offset).get() - << "+" << format_hex(Var.getOffset(), 4) << " [sizeof=" << Length - << "] "; + << "+" << format_hex(Offset + Var.getOffset(), 4) + << " [sizeof=" << Length << "] "; dumpSymbolTypeAndName(*VarType, Var.getName()); break; case PDB_LocType::BitField: Printer.NewLine(); Printer << "data "; WithColor(Printer, PDB_ColorItem::Offset).get() - << "+" << format_hex(Var.getOffset(), 4) << " [sizeof=" << Length - << "] "; + << "+" << format_hex(Offset + Var.getOffset(), 4) + << " [sizeof=" << Length << "] "; dumpSymbolTypeAndName(*VarType, Var.getName()); Printer << " : "; WithColor(Printer, PDB_ColorItem::LiteralValue).get() << Var.getLength(); @@ -91,17 +91,15 @@ void VariableDumper::start(const PDBSymbolData &Var) { } } -void VariableDumper::start(const PDBSymbolTypeVTable &Var) { +void VariableDumper::start(const PDBSymbolTypeVTable &Var, uint32_t Offset) { Printer.NewLine(); - Printer << "data "; + Printer << "vfptr "; auto VTableType = cast<PDBSymbolTypePointer>(Var.getType()); uint32_t PointerSize = VTableType->getLength(); WithColor(Printer, PDB_ColorItem::Offset).get() - << "+" << format_hex(Var.getOffset(), 4) << " [sizeof=" << PointerSize - << "] "; - - WithColor(Printer, PDB_ColorItem::Identifier).get() << " __vfptr"; + << "+" << format_hex(Offset + Var.getOffset(), 4) + << " [sizeof=" << PointerSize << "] "; } void VariableDumper::dump(const PDBSymbolTypeArray &Symbol) { |