-
-
Save gmh5225/d879942bd2c6d125139086b0d1c7d149 to your computer and use it in GitHub Desktop.
Dump C/C++ vtable & record layout information (clang + msvc + gcc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements: | |
# clang - The classes/structs you want to dump must be used in code at least once, not just defined. | |
# MSVC - The classes/structs you want to dump must have "MEOW" in the name for "reportSingleClass" to work. | |
# Usage: | |
# $ make dump_vtables file=test.cpp | |
dump_vtables: | |
clang -cc1 -fdump-record-layouts -emit-llvm $(file) > clang-vtable-layout-$(file).txt | |
clang -cc1 -fdump-vtable-layouts -emit-llvm $(file) > clang-record-layout-$(file).txt | |
g++ -fdump-lang-class=$(file).txt $(file) | |
cl.exe $(file) /d1reportSingleClassLayoutMEOW > msvc-single-class-vtable-layout-$(file).txt | |
cl.exe $(file) /d1reportAllClassLayout > msvc-all-class-vtable-layout-$(file).txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment