Dia2dump Sample

Switch View :
ScriptFree
Debug Interface Access SDK Sample 
Dia2dump Sample 

The Dia2dump sample is installed with Visual Studio and consists of the Dia2dump.cpp source file. The compiled executable runs from the command line and displays the contents of an entire program database (.pdb) file.

To install the sample

  1. Verify that your system meets all setup requirements described in the Visual Studio Setup start page.

  2. Install Visual Studio and follow all setup and installation instructions for the included samples.

The default install directory is [drive:]\Program Files\VSIP X.x\EnvSDK\DSRefTool (where X.x is the current version number), but you can select an alternate directory for installation.

To build the sample

  1. Open the Dia2dump.dsw file in Visual Studio.

  2. From the Build menu, choose Rebuild.

  3. Close Visual Studio.

To run the sample

  • Open a command prompt and type the following:

    dia2dump <filename>
    

See Also

Community Content

EreTIk
***ERROR: Dump All Types (function DumpAllTypes)

Example of DIA SDK ("Dia2Dump" project) versions 8, 9, and now in 10.0 (VS 2010 RC) has a bug in source code. Function DumpAllTypes(...):

bool DumpAllTypes(IDiaSymbol *pGlobal)
{
wprintf(L"\n\n*** TYPES\n");

return DumpAllUDTs(pGlobal) || DumpAllEnums(pGlobal) ||
DumpAllTypedefs(pGlobal);
}

Due to the fact that all three functions return a bool, if successfully work function DumpAllUDTs (it returns true) other two would not be called.

Reproduction Steps: run Dia2Dump with -t option


SkyLined_
Updates to this page
This page does not seem to have had an update since the last millenium. The VS2005 path to the dia2dump solution is:

%ProgramFiles%\Microsoft Visual Studio 8\DIA SDK\Samples\DIA2Dump\dia2dump.sln

or, on x64 systems:

%ProgramFiles(x86)%\Microsoft Visual Studio 8\DIA SDK\Samples\DIA2Dump\dia2dump.sln

Also, there is a divide-by-zero bug in the code in the source file PrintSymbol.cpp, line 1549:

wprintf(L"Summary :\n\tSizeof(Elem) = %d\n\tNo of Elems = %d\n\n", cbTotal/dwElem, dwElem);

At any point "dwElem" can be 0, leading to a divide-by-zero. Here's a suggested fix: remove the line and replace it with these 5 lines:

if (dwElem == 0) { // Avoid divide by zero.
wprintf(L"Summary :\n\tNo of Elems = %d\n\n", dwElem);
} else {
wprintf(L"Summary :\n\tSizeof(Elem) = %d\n\tNo of Elems = %d\n\n", cbTotal/dwElem, dwElem);
}