<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Getting an exception call stack from the catch block (C++)</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx</link><description>This is my first post in this category so I am really looking forward to your comments :-) Today I would like to cover a specific feature related to our implementation of C++ exception handling. Every day I realize that not many people are familiar with</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Getting an exception call stack from the catch block (C++)</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#363443</link><pubDate>Mon, 31 Jan 2005 00:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:363443</guid><dc:creator>Pavel Lebedinsky</dc:creator><description>How did you find the 000af954 value? Is it because it's the next slot on the stack after what looks like the address that the catch block will return to?&lt;br&gt;&lt;br&gt;000af954  000af980&lt;br&gt;000af958  7c3929b5 MSVCR80!_CallCatchBlock2+0x4a &lt;br&gt;&lt;br&gt;By the way, there's more information about .cxr and the magical 0x1003f and 0x1001f numbers in the Mike Stall's blog:&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://blogs.msdn.com/jmstall/archive/2005/01/18/355697.aspx"&gt;http://blogs.msdn.com/jmstall/archive/2005/01/18/355697.aspx&lt;/a&gt;</description></item><item><title>re: Getting an exception call stack from the catch block (C++)</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#363595</link><pubDate>Mon, 31 Jan 2005 11:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:363595</guid><dc:creator>applebean</dc:creator><description>I am also interested for the value 000af954. I wrote the sample code and debugged locally also, the pattern is different. Could you explain a little more?</description></item><item><title>re: Getting an exception call stack from the catch block (C++)</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#363848</link><pubDate>Mon, 31 Jan 2005 19:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:363848</guid><dc:creator>Slava Oks</dc:creator><description>Yes. It appeared to be the first valid frame. So you can do two things here one is to set ebp  to it and see if it works or the other way is run kb=000af954 &lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;By the way, there's more information about .cxr and the magical 0x1003f and 0x1001f numbers in the Mike Stall's blog: &lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;&lt;a target="_new" href="http://blogs.msdn.com/jmstall/archive/2005/01/18/355697.aspx"&gt;http://blogs.msdn.com/jmstall/archive/2005/01/18/355697.aspx&lt;/a&gt; Remove Comment 363443 &lt;br&gt;&lt;br&gt;That is a good point. I saw the post couple of days ago and that is exact reason why I didn't go into details of the magic :-). I forgot to put a pointer. Thank you very much for reminder!</description></item><item><title>re: Getting an exception call stack from the catch block (C++)</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#363854</link><pubDate>Mon, 31 Jan 2005 19:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:363854</guid><dc:creator>Slava Oks</dc:creator><description>&amp;gt;&amp;gt; I am also interested for the value 000af954. I wrote the sample code and debugged locally also, the pattern is different. Could you explain a little more?&lt;br&gt;&lt;br&gt;Yes in you case it will be different. You need to be looking at your thread stack. If you run dps @esp as I did above the first column is thread's stack. The second column is what is stored on the stack. Usually a stack frame contains both address to previous frame and return address. All I did is looked for the pattern that seems to be a valid frame and then tried it. Let me know if you want me to dig more information out for you about how frames getting set and how to traverse them by hand. </description></item><item><title>Interesting finds today</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#364183</link><pubDate>Tue, 01 Feb 2005 04:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:364183</guid><dc:creator>Jason Haley</dc:creator><description>Interesting finds today</description></item><item><title>re: Getting an exception call stack from the catch block (C++)</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#382128</link><pubDate>Tue, 01 Mar 2005 08:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:382128</guid><dc:creator>Bart Duncan</dc:creator><description>A call of a function pushes the return value on the stack first, followed by ebp. &lt;br&gt;&lt;br&gt;When looking at dps/dds output you can identify a likely frame start by looking for a pointer that points to an address just a bit down the stack that could be a valid pushed ebp, followed by what looks like a valid return address.  This matches that pattern: &lt;br&gt;&lt;br&gt;000af954  000af980&lt;br&gt;000af958  7c3929b5 MSVCR80!_CallCatchBlock2+0x4a&lt;br&gt;&lt;br&gt;You can pass the address of the likely ebp to the k command (kv=000af954) to start a stack walk at that point.  This is also a useful trick to recover the second half of a stack that is truncated due to an FPO frame in a module that you don't have symbols for. </description></item><item><title>re: Getting an exception call stack from the catch block (C++)</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#536810</link><pubDate>Wed, 22 Feb 2006 14:31:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:536810</guid><dc:creator>Useful blog</dc:creator><description>Very useful blog. Thank you.</description></item><item><title>re: Getting an exception call stack from the catch block (C++)</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#594959</link><pubDate>Thu, 11 May 2006 02:51:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:594959</guid><dc:creator>Feng Tian</dc:creator><description>Anyone knows the AMD64 counterpart of the magical 0001003f?</description></item><item><title>Windows C++ Exception Handling</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#5403004</link><pubDate>Thu, 11 Oct 2007 20:19:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5403004</guid><dc:creator>MikeKelly's WebLog</dc:creator><description>&lt;p&gt;Good post on how to see the stack when an exception is thrown on Windows at &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/slavao/archive/2005/01/30/363428.asp"&gt;http://blogs.msdn.com/slavao/archive/2005/01/30/363428.asp&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Boxing  &amp;raquo; Blog Archive   &amp;raquo; MikeKelly&amp;#8217;s WebLog</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#6999707</link><pubDate>Sun, 06 Jan 2008 06:17:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6999707</guid><dc:creator>Boxing  » Blog Archive   » MikeKelly’s WebLog</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://boxing.247blogging.info/?p=3202"&gt;http://boxing.247blogging.info/?p=3202&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>La billeterie  &amp;raquo; Blog Archive   &amp;raquo; Analyse mémoire sous windows</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#9561742</link><pubDate>Wed, 22 Apr 2009 11:54:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9561742</guid><dc:creator>La billeterie  &amp;raquo; Blog Archive   &amp;raquo; Analyse mémoire sous windows</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://jmdesp.free.fr/billeterie/?p=168"&gt;http://jmdesp.free.fr/billeterie/?p=168&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Slava Oks s WebLog Getting an exception call stack from the catch | Wood TV Stand</title><link>http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx#9687528</link><pubDate>Wed, 03 Jun 2009 01:21:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9687528</guid><dc:creator> Slava Oks s WebLog Getting an exception call stack from the catch | Wood TV Stand</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://woodtvstand.info/story.php?id=89954"&gt;http://woodtvstand.info/story.php?id=89954&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>