【问题标题】:Got the error "Symbol clr!XXX not found" when debugging the CLR object\class调试 CLR 对象\类时出现错误“Symbol clr!XXX not found”
【发布时间】:2017-11-25 06:01:31
【问题描述】:

我尝试通过 WinDbg 打印 CLR 对象/类,但是失败了。

首先,我尝试运行 x clr!Thread* 来获取一些 CLR 类名,输出如下所示。

00007ffd`68957f18 clr!ThreadStore::s_pOSContext = <no type information>
00007ffd`685b0bf0 clr!ThreadNative::SetApartmentState (<no parameter info>)
00007ffd`685b12c0 clr!ThreadNative::YieldThread (<no parameter info>)
00007ffd`6806be60 clr!Thread::ResetManagedThreadObjectInCoopMode (<no parameter info>)
00007ffd`6895e928 clr!ThreadpoolMgr::LastCPThreadCreation = <no type information>
00007ffd`68627800 clr!ThreadPoolNative::CorUnregisterWait (<no parameter info>)
00007ffd`685b1320 clr!ThreadExceptionState::GetCurrentEHClauseInfo (<no parameter info>)
00007ffd`681285c4 clr!ThreadpoolMgr::ChangeTimerQueueTimer (<no parameter info>)
00007ffd`684c69f0 clr!Thread::BaseWinRTUninitialize (<no parameter info>)
00007ffd`680eea20 clr!ThreadpoolMgr::ShouldGateThreadKeepRunning (<no parameter info>)
00007ffd`684c8ca0 clr!Thread::IsWithinCer (<no parameter info>)
00007ffd`6859a0c0 clr!ThreadpoolMgr::DeleteWait (<no parameter info>)

然后我运行了一些命令,如dt clr!&lt;classname&gt;dt clr!&lt;classname&gt; &lt;objectaddress&gt;,但是它们都不起作用,错误是

符号 clr!xxxxx 未找到。

0:000> dt clr!ThreadNative
Symbol clr!ThreadNative not found.
0:000> dt clr!Thread
Symbol clr!Thread not found.
0:000> dt clr!ThreadpoolMgr
Symbol clr!ThreadpoolMgr not found.

顺便说一句,我找到了other persons got the same issue,但是直到现在还没有解决方案。

但是有些人可以运行dt 命令successfully for the CLR class\object with old version CLR

我确定 CLR 的 PDB 已正确加载。 请帮助检查您是否有相同的问题,如果没有,请告知如何解决该问题。

【问题讨论】:

标签: .net debugging clr windbg


【解决方案1】:

您可能拥有 clr.dll 的公共符号 - 这些是 Microsoft 通常为 clr.dll 和许多其他产品分发的符号。公共符号的设计信息较少,因此预计会失败 dt。

https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/public-and-private-symbols

在您上面提到的链接中,该人似乎可以访问私有符号,但我不知道他们是如何获得它们的。如果您的目标是了解运行时内部的工作原理,CoreCLR 是开源的 (https://github.com/dotnet/coreclr),并且许多内部结构与 clr.dll 高度相似。如果您的目标是调试某些特定的运行时问题,您可以尝试使用 SOS 中可用的命令,或使用 Visual Studio 调试器,或创建另一个 SO 帖子来描述您尝试解决的问题,以便社区可以提供更多建议。

希望对你有帮助,

-Noah Falk(Microsoft .Net 团队)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-17
    • 1970-01-01
    • 2011-05-06
    • 1970-01-01
    • 1970-01-01
    • 2017-10-19
    • 1970-01-01
    • 2018-05-24
    相关资源
    最近更新 更多