在Visual Studio 2010 C ++中调试时如何回溯跟踪

在Visual Studio 2010 C ++中调试时如何回溯跟踪

问题描述:

大家好,

我正在使用VS 2010 Ultimate,

我编写的C ++示例程序在某个时候抛出异常.
有什么方法可以追溯&找出在哪一点抛出异常或错误?
请为我提供相同链接的任何链接

提前致谢. :)

-
更新已从答案中移出

感谢您的答复,

我不希望时间机器只微笑一些日志,该日志可以告诉我哪个函数称为&从哪里抛出异常? ,我认为可能吗?

Hi all ,

i am using VS 2010 Ultimate ,

a c++ sample program writen by me throws an exception at certain point.
is there any way to back trace & find out at which point exception thrown or error occours ?
please provide me any link for the same

thanks in advance. :)

--
update moved from answer

Thanks for your replies ,

I don''t want time machine Smile just some log which will tell me which function called & from where exception thrown ? , i think it is possible right ? this is for thouse unhandle exception which occours unexpectedly.

您可以看一下调用堆栈.这使您可以调用导致错误的函数.请参见此处的简短介绍:
http://msdn.microsoft.com/en-us/library/a3694ts5.aspx [ ^ ]

如果使用的是.NET,则可以使用VS历史调试功能,如下所述:
http://www. wintellect.com/CS/blogs/jrobbins/archive/2009/06/16/how-does-vs2010-historical-debugging-work.aspx [ Visual Studio 2010中的精通调试-入门指南 [
You could have a look at the call stack. This allows you who called the function that caused the error. See here for a short introduction:
http://msdn.microsoft.com/en-us/library/a3694ts5.aspx[^]

If you are using .NET you could use the VS historical debugging feature as described here:
http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/06/16/how-does-vs2010-historical-debugging-work.aspx[^]

You should also definitely read this great CP article that describes a lot of other debugging features:
Mastering Debugging in Visual Studio 2010 - A Beginner''s Guide[^]


我知道了,在Visual Studio跟踪中可用
i got it , it is available in visual studio trace


您的意思是向后运行程序?我怀疑是否有可能(除非您有时间机器)
为什么不处理程序中的异常?这样您会知道它发生在哪里吗?
You mean run the program backwards? I doubt that is possible (unless you have a time machine)
Why not handle exceptions in your program? That way you will know where it occurred?