Home Dashboard Directory Help
Search

DIA SDK dia2dump sample coding mistake prevents dumping of enum and typedef information by theultramage_


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 597862
Opened: 9/14/2010 2:42:51 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

There's a trivial coding mistake in vs2008's and vs2010's "DIA SDK\Samples\DIA2Dump\dia2dump.cpp", line 909, function DumpAllTypes().

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

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

The way it is coded, when DumpAllUDTs() succeeds and returns true, the whole boolean expression short-circuits. This then prevents the other two Dump actions from executing. The result is that the --types output is completely missing global enum and typedef info.

My quick workaround:
- return DumpAllUDTs(pGlobal) || DumpAllEnums(pGlobal) || DumpAllTypedefs(pGlobal);
+ bool result = false;
+ if( DumpAllUDTs(pGlobal) )
+     result = true;
+ if( DumpAllEnums(pGlobal) )
+     result = true;
+ if( DumpAllTypedefs(pGlobal) )
+     result = true;
+ return result;
Details
Sign in to post a comment.
Posted by Microsoft on 10/8/2010 at 11:02 AM
We have the fix checked in for the next version of Visual Studio. The work around provided is straight forward so you know what to do until then. Thank you for your enthusiasm for Visual Studio.
Posted by Microsoft on 9/21/2010 at 9:48 AM
Thanks for the bug report. We will have the DIA sample code fixed in our next release.
Posted by Microsoft on 9/14/2010 at 5:02 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.