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

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 597862 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 9/14/2010 2:42:51 PM
Access Restriction Public


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;
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)