all groups > visual studio .net debugging > july 2004 >
You're in the

visual studio .net debugging

group:

Call stack dump for a point where an exception occurs


Call stack dump for a point where an exception occurs Bae, Hyun-jik
7/27/2004 4:43:08 PM
visual studio .net debugging: Is there any way to dump call stack for a point where an exception occurs
without attaching to a debugger? I guess it'll be a kind of exception
handler code, but I have no idea yet.

Please reply. Thanks in advance.

Bae,Hyun-jik

Re: Call stack dump for a point where an exception occurs Oleg Starodumov
7/29/2004 11:33:26 AM

[quoted text, click to view]

In unmanaged applications, you can use DbgHelp library (StackWalk64 function
and others) in an exception filter:
http://msdn.microsoft.com/library/en-us/debug/base/stackwalk64.asp

You can find various examples on the Internet (search for "StackWalk").
For example:
http://msdn.microsoft.com/msdnmag/issues/02/03/hood/default.aspx
(warning: it is a good example of stack walking, though be aware that when it
comes to dumping local variables, the approach used by the article is far from enough)

In managed applications, you can use StackTrace property of the exception object.

Regards,
Oleg







AddThis Social Bookmark Button