Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
663 views
in Technique[技术] by (71.8m points)

.net - Got the error "Symbol clr!XXX not found" when debugging the CLR objectclass

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

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>)

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

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, I found other persons got the same issue, however no solution until now.

However some person can run the dt command successfully for the CLR classobject with old version CLR.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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/en-us/windows-hardware/drivers/debugger/public-and-private-symbols

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.

Hope this helps,

-Noah Falk (Microsoft .Net team)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...