如何跳回在Visual Studio 2010调试器中抛出异常的代码行? [英] How to jump back to the line of code that threw exception in Visual Studio 2010 debugger?

查看:282
本文介绍了如何跳回在Visual Studio 2010调试器中抛出异常的代码行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2010调试器,我熟悉使用调用堆栈窗口来查看当前正在执行的函数的调用位置。



我正在使用一些应用程序有相当大的尝试块。假设我在 catch 块中的断点处暂停执行代码,最简单的方法来告诉try块中的哪一行异常是从? / p>

我知道堆栈跟踪包括线路号等细节,但是有一个更简单的方法,如快捷键,可以导航回线路的代码提出了异常?



更新:我想强调,我不希望将执行点移回 try block;我只想要一个更简单的方式来知道异常是从哪个引出的。

解决方案

如果你去DEBUG,异常...,然后根据通用语言运行时异常选择抛出。





然后,当你的代码遇到异常时,它将停止在错误的行。


Using the Visual Studio 2010 debugger, I am familiar with using the Call Stack window to see where the currently executing function was invoked from.

I'm working with some applications that have rather large try blocks. Supposing that I pause execution of the code at a break point in the catch block, what is the simplest way to tell which line in the try block the exception was raised from?

I do know that the "Stack Trace" includes details such as the line number, but is there an easier way, such as a shortcut key, to navigate back to the line of code where the exception was raised?

Update: I would like to emphasize that I don't wish to move the execution point back to the try block; I simply want a simpler way of knowing which line the exception was raised from.

解决方案

If you goto "DEBUG", "Exceptions..." and then select "Thrown" against "Common Language Runtime Exceptions".

Then when your code encounters an exception it will stop on the line with the error.

这篇关于如何跳回在Visual Studio 2010调试器中抛出异常的代码行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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