Command line tool that reports size of things (functions, data, classes, templates, object files) in a Visual Studio compiled exe/dll. Extracts info from debug information (.pdb) file.
Based on code by Fabian "ryg" Giesen (farbrausch.com/~fg).
Version 0.1.3 here (53 KB). Includes executable, source and project file for Visual Studio 2003.
It requires either having Visual Studio 2003/2005 to be installed, or having msdia71.dll or msdia80.dll in Sizer's folder on in path. Since I'm not sure what are distribution terms of msdia*.dll, I'm not including it in the download. It looks like VS2005 redist does contain the dlls.
Output will look like this:
Functions by size (kilobytes):
3.37: _input input.obj
2.04: _woutput woutput.obj
1.99: _output output.obj
1.51: CWnd::OnWndMsg wincore.obj
1.47: ATL::AtlIAccessibleInvokeHelper wincore.obj
1.17: TZip::Add XZip.obj
1.05: __strgtold12 strgtold.obj
1.02: GetOpenGLInfo BugSystemInfo.obj
1.00: crc_table <no objfile>
0.98: CWnd::FilterToolTipMessage tooltip.obj
0.93: __crtLCMapStringA a_map.obj
0.93: Uploader::DoUpload Uploader.obj
...more
Aggregated templates by size (kilobytes):
1.58 # 3: std::vector::_Insert_n
0.79 # 8: std::basic_string::append
0.53 # 6: std::basic_string::assign
Data by size (kilobytes):
10.46: __NULL_IMPORT_DESCRIPTOR OPENGL32.dll
6.00: _afxMsgCache wincore.obj
BSS by size (kilobytes):
4.00: _bufin * Linker *
Classes/Namespaces by code size (kilobytes):
74.54: <global>
11.43: CWnd
3.68: Uploader
...more
Object files by code size (kilobytes):
17.37: wincore.obj
13.05: XZip.obj
8.82: Dlg.obj
4.02: Uploader.obj
3.88: BugSystemInfo.obj
...more
Overall code: 142.77 kb
Overall data: 52.75 kb
Overall BSS: 4.00 kb
0.1.3, 2008 01 17 aras: fixed a crash on some executables (IDiaSymbol2::get_type may return S_FALSE). Reported by Ivan-Assen Ivanov. aras: print a dot for each 1000 symbols read. Some executables spend ages inside DIA dlls. 0.1.2, 2008 01 14 ryg: added support for VC8.0 DIA DLL ryg: added support for loading DIA DLLs that are not registered (drop msdia*.dll into app folder) ryg: split up "data" report into data and BSS (uninitialized data) sections ryg: fixed some size computations aras: strip whitespace from symbol names (often happens with templates) 0.1.1, 2008 01 13 aras: improved error messages aras: removed unused source files 0.1, 2008 01 13 initial release