Search

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

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)
0
User(s) can reproduce this bug
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 (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Reliability

Steps to reproduce

1. Build the DIA2Dump sample
2. Prepare a pdb file
3. Run dia2dump.exe --types file.pdb > types.txt
4. Open types.txt and look for an ENUMS or TYPEDEFS section

Product Language

English

Operating System

Windows Vista

Operating System Language

English

Actual results

If executing properly, the TYPES section should be followed by an ENUMS and a TYPEDEFS section.

Expected results

There is only a TYPES section; global enum and typedef information is completely omitted.
File Attachments
0 attachments
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.