Factor out the checking of string tables.
[oota-llvm.git] / tools / llvm-pdbdump / FunctionDumper.cpp
index ac7ab49575625014a3ce1337934a7d9e10910f92..9584812e81a945af9f4a8c192f0cebc03e30afcb 100644 (file)
@@ -109,31 +109,31 @@ void FunctionDumper::start(const PDBSymbolTypeFunctionSig &Symbol,
 }
 
 void FunctionDumper::start(const PDBSymbolFunc &Symbol, PointerType Pointer) {
-  uint32_t FuncStart = Symbol.getRelativeVirtualAddress();
-  uint32_t FuncEnd = FuncStart + Symbol.getLength();
+  uint64_t FuncStart = Symbol.getVirtualAddress();
+  uint64_t FuncEnd = FuncStart + Symbol.getLength();
 
-  Printer << "func ";
-  WithColor(Printer, PDB_ColorItem::Address).get() << "["
-                                                   << format_hex(FuncStart, 8);
+  Printer << "func [";
+  WithColor(Printer, PDB_ColorItem::Address).get() << format_hex(FuncStart, 10);
   if (auto DebugStart = Symbol.findOneChild<PDBSymbolFuncDebugStart>()) {
-    uint32_t Prologue = DebugStart->getRelativeVirtualAddress() - FuncStart;
+    uint64_t Prologue = DebugStart->getVirtualAddress() - FuncStart;
     WithColor(Printer, PDB_ColorItem::Offset).get() << "+" << Prologue;
   }
-  WithColor(Printer, PDB_ColorItem::Address).get() << " - "
-                                                   << format_hex(FuncEnd, 8);
+  Printer << " - ";
+  WithColor(Printer, PDB_ColorItem::Address).get() << format_hex(FuncEnd, 10);
   if (auto DebugEnd = Symbol.findOneChild<PDBSymbolFuncDebugEnd>()) {
-    uint32_t Epilogue = FuncEnd - DebugEnd->getRelativeVirtualAddress();
+    uint64_t Epilogue = FuncEnd - DebugEnd->getVirtualAddress();
     WithColor(Printer, PDB_ColorItem::Offset).get() << "-" << Epilogue;
   }
-  WithColor(Printer, PDB_ColorItem::Address).get() << "] ";
+  Printer << "] (";
 
-  if (Symbol.hasFramePointer())
-    WithColor(Printer, PDB_ColorItem::Address).get()
-        << "(" << Symbol.getLocalBasePointerRegisterId() << ")";
-  else
-    WithColor(Printer, PDB_ColorItem::Address).get() << "(FPO)";
+  if (Symbol.hasFramePointer()) {
+    WithColor(Printer, PDB_ColorItem::Register).get()
+        << Symbol.getLocalBasePointerRegisterId();
+  } else {
+    WithColor(Printer, PDB_ColorItem::Register).get() << "FPO";
+  }
+  Printer << ") ";
 
-  Printer << " ";
   if (Symbol.isVirtual() || Symbol.isPureVirtual())
     WithColor(Printer, PDB_ColorItem::Keyword).get() << "virtual ";