我目前正在从使用DIA SDK检索到的XML文件的PDB文件中转储大量信息,以便我可以使用该信息显示有关项目结构的内容等。
为了命名XML节点,我有一个简单的函数,它将枚举的值转换为一个字符串,然后用于节点:
string symTagTypeToString(DWORD type) {
string symTagTypename = "";
switch(type) {
case SymTagNull:
symTagTypename = "null";
break;
case SymTagExe:
symTagTypename = "exe";
break;
case SymTagCompiland:
symTagTypename = "compiland";
break;
case SymTagCompilandDetails:
symTagTypename = "compilandDetails";
break;
case SymTagCompilandEnv:
symTagTypename = "compilandEnvironmentVar";
break;
case SymTagFunction:
symTagTypename = "function";
break;
case SymTagBlock:
symTagTypename = "block";
break;
case SymTagData:
symTagTypename = "data";
break;
case SymTagAnnotation:
symTagTypename = "annotation";
break;
case SymTagLabel:
symTagTypename = "label";
break;
case SymTagPublicSymbol:
symTagTypename = "publicSymbol";
break;
case SymTagUDT:
symTagTypename = "userDefinedType";
break;
case SymTagEnum:
symTagTypename = "enumerator";
break;
case SymTagFunctionType:
symTagTypename = "functionType";
break;
case SymTagPointerType:
symTagTypename = "pointer";
break;
case SymTagArrayType:
symTagTypename = "array";
break;
case SymTagBaseType:
symTagTypename = "baseType";
break;
case SymTagTypedef:
symTagTypename = "typedef";
break;
case SymTagBaseClass:
symTagTypename = "baseClass";
break;
case SymTagFriend:
symTagTypename = "friend";
break;
case SymTagFunctionArgType:
symTagTypename = "functionArgumentType";
break;
case SymTagFuncDebugStart:
symTagTypename = "funcDebugStart";
break;
case SymTagFuncDebugEnd:
symTagTypename = "funcDebugEnd";
break;
case SymTagUsingNamespace:
symTagTypename = "usingNamespace";
break;
case SymTagVTableShape:
symTagTypename = "vTableShape";
break;
case SymTagVTable:
symTagTypename = "vTable";
break;
case SymTagCustom:
symTagTypename = "custom";
break;
case SymTagThunk:
symTagTypename = "thunk";
break;
case SymTagCustomType:
symTagTypename = "customType";
break;
case SymTagManagedType:
symTagTypename = "managedType";
break;
case SymTagDimension:
symTagTypename = "dimension";
break;
default:
ostringstream s;
s << "other" << type;
symTagTypename = s.str();
break;
}
return symTagTypename;
}
此功能包含此处列出的所有值:http://msdn.microsoft.com/de-de/library/bkedss5f.aspx
现在,为了转储DIA信息,我基本上只使用pGlobal->findChildren(SymTagUDT, NULL, nsCaseSensitive, &pIDiaEnumSymbols)
递归所有符号的子项。奇怪的是,生成的XML包含很多看起来像这样的东西:
<function name="consumer::main">
<funcDebugStart name="unknown">
</funcDebugStart>
<funcDebugEnd name="unknown">
</funcDebugEnd>
<data name="">
</data>
<data name="">
</data>
<data name="">
</data>
<data name="this">
</data>
<data name="c">
</data>
<other31 name="unknown">
</other31>
<other31 name="unknown">
</other31>
<other31 name="unknown">
</other31>
<other31 name="unknown">
</other31>
<other31 name="unknown">
</other31>
<other31 name="unknown">
</other31>
<other31 name="unknown">
</other31>
<other31 name="unknown">
</other31>
</function>
现在,永远不要忘记空名称信息和内容,到目前为止还没有完成。我真的很想知道什么样的符号有 symTag 31 。枚举器似乎包含31个元素,因此0到30之间的值应该是有效的。有谁知道这31可能是什么?有问题的功能如下:
void main()
{
char c;
cout << endl << endl;
while (true) {
in->read(c);
cout << c << flush;
if (in->num_available() == 1)
cout << "<1>" << flush;
if (in->num_available() == 9)
cout << "<9>" << flush;
}
}
它是SystemC fifo示例项目的一部分。没什么太奇特的,真的。
答案 0 :(得分:0)
在VS2010附带的DIA SDK版本中,添加了两个SymTagEnum值SymTagCallSite和SymTagMax(尽管它们尚未包含在文档中)。虽然我对这些价值所代表的语义仍然没有真正的了解,但这无疑解释了我所获得的价值观。