简体   繁体   English

Visual Studio调试,跳转到方法结束或调用方法

[英]Visual Studio debug, jump to end of method, or to calling method

I fairly often get to a state in VS (C#) debug breakpoint or exception where I want to exit out of several levels of method to a caller a few levels up the stack. 我经常在VS(C#)调试断点或异常中达到一种状态,在这种情况下,我希望退出几个级别的方法,在堆栈的几个级别上调用一个调用者。 I can then patch up/retry/etc. 然后我可以修补/重试/等。

In simple cases I can [1] find the end of the current method, [2] set next statement, and [3] step out. 在简单的情况下,我可以[1]找到当前方法的结束,[2]设置下一个语句,[3]步出。 Then repeat 1/2/3 working my way up the calling stack till I get where I want to be. 然后重复1/2/3向我的方向靠近调用堆栈,直到我到达我想要的位置。 However, this is a decided pain .... 然而,这是一个决定性的痛苦......

Can anyone suggest any automation to help this? 有人可以建议任何自动化来帮助这个吗? In order of preference .... 按优先顺序....

  1. jump all the way out to where I want to be in one go 一路跳到我想要的地方
  2. combine 1/2/3 in a single shortcut I can quickly repeat 将1/2/3组合成一个快捷方式我可以快速重复
  3. just automate step 1 (steps 2 and 3 are easy with standard shortcuts). 只需自动执行第1步(使用标准快捷键可轻松完成步骤2和3)。

(I've tried searching, but all the terms I can think of are so generic that I haven't got any useful answers). (我试过搜索,但我能想到的所有术语都是如此通用,以至于我没有得到任何有用的答案)。

Shift-F11退出当前方法。

调试器没有办法将下一个语句设置为在堆栈顶部的当前方法之外的某处执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM