[PATCH] D33996: Improve consistency and flexibility with llvm-pdbdump subcommands

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 09:21:16 PDT 2017


zturner created this revision.

We had the pdb2yaml and raw options which each dumped pdb in a different way.  But many of the options were effectively the same, but spelled differently.  For example, we had:

      pdb2yaml            |     raw
  ---------------------------------------
  -dbi-module-syms        | -module-syms
  -dbi-module-info        | -modules
  -dbi-module-source-info | -module-files
  -dbi-module-lines	     | -line-info

Furthermore, they didn't appear in the same categories in their respective subcommands, had different help text, stored the results in different variables, etc.  So this patch aims to fix all of that by having one set of variables that are shared among subcommands.

At the same time, we need to improve the granularity by which we can dump module subsections.  Previously, `line-info` and `dbi-module-lines` really means "dump all the subsections of each module's debug stream".  But some of those subsections are actually not about lines at all.  There's Frame Data, Checksums, even symbols can show up.  What we'd really like is a way to specify exactly which subsections are dumped.   So the `-line-info` is changed to an enum value that looks like this:

  -subsections              - dump subsections from each module's debug stream
    =cme                    -   Cross module exports (DEBUG_S_CROSSSCOPEEXPORTS subsection)
    =cmi                    -   Cross module imports (DEBUG_S_CROSSSCOPEIMPORTS subsection)
    =fc                     -   File checksums (DEBUG_S_CHECKSUMS subsection)
    =ilines                 -   Inlinee lines (DEBUG_S_INLINEELINES subsection)
    =lines                  -   Lines (DEBUG_S_LINES subsection)
    =all                    -   All known subsections

and you can specify one or more of these values separated by commas.  This makes it easy to add support for other subsections in future patches.  Another benefit is that it allows us to consolidate some of the tests.  I was able to convert 3 different tests which did mostly the same thing but with different subsections into a single test which tests all subsections at once.


https://reviews.llvm.org/D33996

Files:
  llvm/test/DebugInfo/PDB/Inputs/cross-module-import-export.yaml
  llvm/test/DebugInfo/PDB/Inputs/debug-subsections.yaml
  llvm/test/DebugInfo/PDB/Inputs/simple-line-info.yaml
  llvm/test/DebugInfo/PDB/cross-module-import-export.test
  llvm/test/DebugInfo/PDB/pdb-minimal-construct.test
  llvm/test/DebugInfo/PDB/pdb-yaml-symbols.test
  llvm/test/DebugInfo/PDB/pdbdump-debug-subsections.test
  llvm/test/DebugInfo/PDB/pdbdump-headers.test
  llvm/test/DebugInfo/PDB/pdbdump-readwrite.test
  llvm/test/DebugInfo/PDB/pdbdump-source-names.test
  llvm/test/DebugInfo/PDB/pdbdump-write.test
  llvm/test/DebugInfo/PDB/pdbdump-yaml-lineinfo-write.test
  llvm/test/DebugInfo/PDB/pdbdump-yaml-lineinfo.test
  llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
  llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp
  llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
  llvm/tools/llvm-pdbdump/llvm-pdbdump.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33996.101754.patch
Type: text/x-patch
Size: 41817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170607/cbb4ef6e/attachment.bin>


More information about the llvm-commits mailing list