出现错误“找不到符号clr!XXX”。调试CLR对象时 [英] Got the error "Symbol clr!XXX not found" when debugging the CLR object\class

查看:108
本文介绍了出现错误“找不到符号clr!XXX”。调试CLR对象时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I tried to print the CLR object/class by WinDbg, however it failed.

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

Firstly, I tried to run x clr!Thread* to get some CLR class name, the output like below.

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!< classname> dt clr!< classname> < objectaddress> ,但是它们都不起作用,错误是

Then I run some commands like dt clr!<classname> or dt clr!<classname> <objectaddress>, however none of them worked and the error is


找不到符号clr!xxxxx。

Symbol clr!xxxxx not found.



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.

BTW,我发现其他人也遇到了同样的问题,但是直到现在都没有解决办法。

BTW, I found other persons got the same issue, however no solution until now.

但是有人可以运行 dt 命令成功使用旧版本CLR的CLR类\对象

However some person can run the dt command successfully for the CLR class\object with old version CLR.

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

I sure the PDB for the CLR loaded correctly. Please help to check if your have the same issues, if not please advise how to fix that issue.

推荐答案

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

You probably have the public symbols for clr.dll - these are the symbols Microsoft normally distributes for clr.dll and many other products. Public symbols have less information in them by design so failing dt is expected.

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

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

In the link you mentioned above it appears that person has access to the private symbols, but I don't know how they obtained them. If your goal is to understand how the runtime works internally, CoreCLR is open source (https://github.com/dotnet/coreclr) and many of the internals are highly similar to clr.dll. If your goal is to debug some particular runtime issue you can try using the commands available in SOS, or use Visual Studio debugger, or create another SO post describing the problem you are trying to solve so that the community can offer additional suggestions.

希望这会有所帮助,

-Noah Falk(Microsoft .Net团队)

-Noah Falk (Microsoft .Net team)

这篇关于出现错误“找不到符号clr!XXX”。调试CLR对象时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆