这个CopyPDBs函数是什么(来自clr.dll)在做什么? [英] What is this CopyPDBs function (from clr.dll) doing?

查看:210
本文介绍了这个CopyPDBs函数是什么(来自clr.dll)在做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用Process Explorer分析运行IIS的生产环境中的ASP.NET MVC应用程序时,我注意到从<$($)$ CopyPDBs 函数调用很多c $ c> C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll :

When using Process Explorer to analyze an ASP.NET MVC application in a production environment running IIS, I've noticed a lot of calls to this CopyPDBs function from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll:

所有这些都具有完全相同的堆栈跟踪:

All of them are having the exact same stack trace:

ntdll.dll!ZwWaitForSingleObject+0xa
KERNELBASE.dll!WaitForSingleObjectEx+0x98
clr.dll!GetMetaDataInternalInterface+0x3064a
clr.dll!GetMetaDataInternalInterface+0x30732
clr.dll!GetMetaDataInternalInterface+0x306e5
clr.dll!CopyPDBs+0x44a2
KERNEL32.DLL!BaseThreadInitThunk+0x22
ntdll.dll!RtlUserThreadStart+0x34

我的问题是:这是什么 CopyPDBs function from crr.dll 正好在做什么?

My question is: What is this CopyPDBs function from the clr.dll exactly doing?

我搜索了很多但仍然无法找到这个功能的任何exaplanation和/或文档。

I've searched a lot but still can't find any exaplanation and/or documentation of this function.

注意:这个问题与我之前的一个问题有关,在ServerFault中问: https://serverfault.com / questions / 684554 / high-cpu-usage-of-iis-process-w3wp-exe-because-of-many-slow-clr-dllcopypdbs

推荐答案

它没有做任何事情。进程资源管理器无法访问clr.dll的PDB文件,因此它对代码不够了解。当您看到已知符号的指令偏移量时,总是非常明显的, + 0x44a2 长于CopyPDBs()函数。您从clr.dll看到的所有符号都是垃圾。来自ntdll.dll的符号是好的,请注意小的偏移量。

It is not doing anything. Process Explorer does not have access to the PDB file for clr.dll so it doesn't know enough about the code. Always very evident when you look at the instruction offset from the known symbol, +0x44a2 is long, long past the CopyPDBs() function. All of the symbols you see from clr.dll are junk. The symbols from ntdll.dll are good, note the small offsets.

如果没有为DLL中的内部函数提供符号的PDB文件,调试器只能依赖于导出功能。 Clr.dll没有很多。

Without a PDB file that provides symbols for internal functions in a DLL, a debugger can only rely on exported functions. Clr.dll does not have many of them.

帮助过程浏览器显示更好的堆栈跟踪是这篇博文

Helping Process Explorer show better stack traces is the subject of this blog post.

Windbg不是唯一的办法,您也可以使用Visual Studio:

Windbg isn't the only way, you can also do it with Visual Studio:


  1. 工具>选项>调试>符号。勾选Microsoft Symbol
    服务器复选框并选择缓存目录。

  2. 项目>属性>调试>勾选启用本地代码调试选项。

  3. 按F5,您将看到调试器下载符号。有一段时间,它只发生一次。

  4. 告诉Process Explorer关于通过选项>配置符号选择的缓存目录。

  1. Tools > Options > Debugging > Symbols. Tick the "Microsoft Symbol Servers" checkbox and select a cache directory.
  2. Project > Properties > Debug > tick the "Enable native code debugging" option.
  3. Press F5, you'll see the debugger downloading the symbols. Takes a while, it happens just once.
  4. Tell Process Explorer about the cache directory you picked with Options > Configure Symbols.

这篇关于这个CopyPDBs函数是什么(来自clr.dll)在做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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