现在的位置: 首页 > 综合 > 正文

try/catch的实现原理 —转

2013年01月08日 ⁄ 综合 ⁄ 共 507字 ⁄ 字号 评论关闭
转:try/catch的实现原理

1. VC++的try/catch是基于Win32的SEH实现的。

2. try/catch只能捕捉当前线程的异常,每个线程都有自己的异常处理入口。

3. 异常处理入口是由OS负责调用的,在异常发生时。

4. 为了使用SEH,VC++编译器自动生成了很多的代码。

MSDN上关于SEH的经典文章

A Crash Course on the Depths of Win32™ Structured Exception Handling

http://www.microsoft.com/msj/0197/exception/exception.aspx

深入探索Win32结构化异常处理

http://blog.csdn.net/diamont/archive/2009/06/11/4259590.aspx

CodeProject上的模拟实现

How a C++ compiler implements exception handling

CLR的实现

The Exception Model


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/optman/archive/2008/06/03/2508323.aspx

抱歉!评论已关闭.