[PATCH] D23629: Make llvm-pdbdump print column info when available

Adrian McCarthy via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 15:09:33 PDT 2016


amccarth created this revision.
amccarth added a reviewer: rnk.
amccarth added a subscriber: llvm-commits.

llvm-pdbdump already had code to retrieve column information in the line tables, but it wasn't using it.

Most Microsoft PDBs don't seem to have column info, so this wasn't missed.  But Clang includes column info by default (at least for now), and being able to see that is useful for ensuring we get the column info correct.

I don't see many tests for llvm-pdbdump, so it's not obvious to me where or how a test for this should be written.  Tested locally on a couple PDBs and noted that it gracefully displays line tables with and without column info.

https://reviews.llvm.org/D23629

Files:
  tools/llvm-pdbdump/CompilandDumper.cpp

Index: tools/llvm-pdbdump/CompilandDumper.cpp
===================================================================
--- tools/llvm-pdbdump/CompilandDumper.cpp
+++ tools/llvm-pdbdump/CompilandDumper.cpp
@@ -76,6 +76,15 @@
         if (LineStart != LineEnd)
           WithColor(Printer, StatementColor).get() << " - " << LineEnd;
 
+        uint32_t ColumnStart = Line->getColumnNumber();
+        uint32_t ColumnEnd = Line->getColumnNumberEnd();
+        if (ColumnStart != 0 || ColumnEnd != 0) {
+            Printer << ", Column: ";
+            WithColor(Printer, StatementColor).get() << ColumnStart;
+            if (ColumnEnd != ColumnStart)
+                WithColor(Printer, StatementColor).get() << " - " << ColumnEnd;
+        }
+
         Printer << ", Address: ";
         if (Line->getLength() > 0) {
           uint64_t AddrStart = Line->getVirtualAddress();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23629.68428.patch
Type: text/x-patch
Size: 872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160817/2f5e5da0/attachment.bin>


More information about the llvm-commits mailing list