【问题标题】:Why DIA SDK get_libraryName symbol returns NULL for IDiaSymbol?为什么 DIA SDK get_libraryName 符号为 IDiaSymbol 返回 NULL?
【发布时间】:2010-11-18 18:57:06
【问题描述】:

我需要从函数枚举的位置找到正确的 .dll/.exe。为此,我使用 get_libraryName,它应该返回最初定义函数的文件名(.dll/.exe)。

但它每次都返回 NULL(BadPtr=0x00000).. 有没有办法从定义和使用函数的地方检索确切的文件名?

问候 哈桑

【问题讨论】:

  • 那么,关于发生这种情况的功能,DIA 还为您提供了哪些其他信息?首先,这些函数的名称是什么?

标签: debugging visual-c++ debug-symbols pdb-files dia-sdk


【解决方案1】:
IDiaSession mSession;
DiaSourceClass mSourceClass;
IDiaSymbol mGlobalScope;
string pdbFileName = @"c:\test.pdb";

mSourceClass = new DiaSourceClass();
mSourceClass.loadDataFromPdb(pdbFileName);
mSourceClass.openSession(out mSession);
mSession.loadAddress = loadAddress; 
mGlobalScope = mSession.globalScope;

IDiaEnumSymbols methodSymbols;
mGlobalScope.findChildren(SymTagEnum.SymTagFunction, null, 0, out methodSymbols);
foreach (IDiaSymbol methodSymbol in methodSymbols)
{
     string projectName = functionSymbol.lexicalParent.name;
}

希望这会有所帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-12-26
    • 2016-12-28
    • 1970-01-01
    • 2017-10-04
    • 1970-01-01
    • 2015-11-25
    • 2015-07-04
    • 2019-09-29
    相关资源
    最近更新 更多