【发布时间】:2020-04-23 09:36:00
【问题描述】:
我在 GC 循环结束时设置条件断点。
程序会中断,但它无法评估 GcCondemnedGeneration 变量,因此程序会在每次 GC 循环时中断,而不管收集的实际代数如何。
这是断点命令:
> bp clr!ThreadSuspend::RestartEE ".if @@(clr!SVR::GCHeap::GcCondemnedGeneration==2) {kb} .else {g}"
这是我在断点中断时得到的:
Type information missing error for SVR::GCHeap::GcCondemnedGeneration
Couldn't resolve error at 'clr!SVR::GCHeap::GcCondemnedGeneration==2) {kb} .else {g}'
clr!ThreadSuspend::RestartEE:
00007fff`145d5dfc 488bc4 mov rax,rsp
我尝试了各种变体,但都失败了。
机器上安装的.Net版本是4.6.1。
我的程序使用服务器 gc 运行。
clr.dll 符号加载成功。
谢谢
【问题讨论】:
-
你想达到什么目的? GC 结束时你想要一个本地调用栈吗?这有什么用?
-
虽然我能够让它工作,但我很想看到@ThomasWeller 问题的答案!
-
我对调用堆栈并不感兴趣,我有兴趣在 GC gen2 之后立即转储 Gen2。我在问题中使用的 kb 只是为了简单起见。
标签: .net garbage-collection windbg conditional-breakpoint