简体   繁体   English

在Visual Studio中将调试器上移

[英]Move debugger up the stack in Visual Studio

Visual studio (I'm using Community 2015) allows you to drag and drop the yellow execution pointer around in the same function. Visual Studio(我正在使用Community 2015)允许您在同一函数中拖放黄色执行指针。

Is there a way to move that pointer up the stack, and especially when the debugger is waiting on the user after an exception has been thrown? 有没有一种方法可以将该指针移到堆栈上,特别是当引发异常后调试器正在等待用户时?

EDIT: Ideally no user code should execute during that process, as it can mess things up with other variables 编辑:理想情况下,在此过程中不应执行任何用户代码,因为它可能会使其他变量混乱

Use the 'Step Out' functionality. 使用“跳出”功能。

Shift + F11 Shift + F11

is the shortcut by default. 是默认情况下的快捷方式。

Just a caveat: stepping out will execute the rest of the code in the method before going back up the stack. 只是一个警告:单步执行将在返回堆栈之前执行方法中的其余代码

I found a way. 我找到了一个方法。 This is maybe not the easiest way around, but it's always possible to 这可能不是最简单的方法,但始终可以

  • first drag and drop the yellow arrow to the end of the current function 首先将黄色箭头拖放到当前功能的末尾
  • the execute as many step-out (Shift-F11) and "drag-to-end-of-function" as required 根据需要执行尽可能多的步长(Shift-F11)和“拖动至功能结束”

Of course it will "execute" some code, but if carefully done, it's only stack managing code, not user code, thus should not interfere with user variables. 当然,它将“执行”某些代码,但是如果仔细完成,它仅是堆栈管理代码,而不是用户代码,因此不应干扰用户变量。

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

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