.Net - 什么是“放松”?
在回答这个 问题 我注意到在处理异常时尝试移动“光标”时出现以下对话框:
无法将下一条语句设置到此位置。尝试展开调用堆栈失败。
在以下情况下无法展开:
- 调试是通过即时调试启动的。
- 放松正在进行中
- 抛出了 System.StackOverflowException 或 System.Threading.ThreadAbortException 异常。
到底什么是放松?
While answering this question I noticed that I got the following dialog while atempting to move the "cursor" while an exception was being handled:
Unable to set the next statement to this location. The attempt to unwind the callstack failed.
Unwinding is not possible in the following scenarios:
- Debugging was started via Just-In-Time debugging.
- An unwind is in progress
- A System.StackOverflowException or System.Threading.ThreadAbortException exception has been thrown.
What exactly is an unwind?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
CLR 在此处“展开”堆栈,以便找到带有可以处理异常的 catch 块的方法,即,如果当前方法不处理异常,则它会返回到调用它的方法以查看是否会处理异常。 。重复此过程,直到找到处理异常的方法或达到应用程序级别错误处理。
This where the CLR is 'unwinding' the stack in order to locate a method with a catch block that can handle the exception i.e. if the current method doesn't handle the exception it then returns to the method that called it to see if it will. This is repeated until it either finds a method to handle the exception or hits application level error handling.
这意味着有一个错误的线程,或者可能是因为堆栈已满并且没有创建堆栈帧,在这种情况下,CLR 选择 UNWIND 当前上下文。
It means there is a faulty thread or probably that is because the stack is full and no stack frame is created, the CLR as opts to UNWIND the current context in this situation.
是我!不,在这种情况下,它通常指的是在堆栈中逐步(“向后”/“向上”)的过程,删除连续的帧,直到回到所需的级别。典型的堆栈(当然)在结构上非常线性,帧是端到端堆叠的,因此实际上并没有太多字面展开,但这就是它的名称。
此维基百科页面有更多详细信息。
It's me!No, in this context it typically refers to the process of stepping ("backwards"/"upwards") through a stack, removing successive frames until you've come back to the desired level. Typical stacks are (of course) very linear in their structure, frames are stacked end-to-end after each other, so there's not really much literal unwinding going on, but that's what it's called.
This Wikipedia page has more detail.
展开只是将堆栈移回到堆栈上。
Unwinding is just moving back up the stack.