Skip to content

Instantly share code, notes, and snippets.

@swwwolf
Last active November 5, 2017 11:46
Show Gist options
  • Save swwwolf/1ee679d418f18c1d943d902928947ce4 to your computer and use it in GitHub Desktop.
Save swwwolf/1ee679d418f18c1d943d902928947ce4 to your computer and use it in GitHub Desktop.
Using llvm-pdbutil to dump and compare type definition(s)
::https://llvm.org/docs/CommandGuide/llvm-pdbutil.html
@echo off
:main
setlocal enableextensions
if [%1]==[] goto usage
if [%2]==[] goto usage
if [%3]==[] goto usage
if [%4]==[] goto usage
set vstudio="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe"
set first_pdb=%1
set first_structure=%2
set first_structure_out=%first_pdb%.src
set second_pdb=%3
set second_structure=%4
set second_structure_out=%second_pdb%.dst
:process
llvm-pdbutil.exe pretty -classes -class-recurse-depth=1 -include-types="^%first_structure%$" %first_pdb% >%first_structure_out%
llvm-pdbutil.exe pretty -classes -class-recurse-depth=1 -include-types="^%second_structure%$" %second_pdb% >%second_structure_out%
call %vstudio% /diff %first_structure_out% %second_structure_out%
goto :eof
:usage
@echo Usage: %0 first_pdb first_structure second_pdb second_structure
exit 1
::https://llvm.org/docs/CommandGuide/llvm-pdbutil.html
@echo off
:main
setlocal enableextensions
if [%1]==[] goto usage
if [%2]==[] goto usage
set first_pdb=%1
set first_structure=%2
set first_structure_out=%first_pdb%.src
:process
llvm-pdbutil.exe pretty -classes -include-types="^%first_structure%$" %first_pdb% >%first_structure_out%
goto :eof
:usage
@echo Usage: %0 first_pdb first_structure
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment