{"id":276008,"date":"2016-03-13T21:09:02","date_gmt":"2016-03-13T18:09:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=276008"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=276008","title":{"rendered":"\u0421++ exception handling \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c. \u0427\u0430\u0441\u0442\u044c 3"},"content":{"rendered":"<p>       \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0432 C++<\/p>\n<p>  <a href=\"https:\/\/habrahabr.ru\/post\/279111\/\">1 \u0447\u0430\u0441\u0442\u044c<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/post\/279151\/\">2 \u0447\u0430\u0441\u0442\u044c<\/a><\/p>\n<h1>C++ exceptions \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u043f\u043e\u0438\u0441\u043a \u0432\u0435\u0440\u043d\u043e\u0433\u043e landing pad<\/h1>\n<p>  \u042d\u0442\u043e \u0443\u0436\u0435 15-\u044f \u0433\u043b\u0430\u0432\u0430 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438. \u041c\u044b \u0443\u0436\u0435 \u0438\u0437\u0443\u0447\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0438 \u0434\u0430\u0436\u0435 \u0438\u043c\u0435\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0439 \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f catch-\u0431\u043b\u043e\u043a (landing pad \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439). \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043e\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 landing pad (\u0442.\u0435. \u043f\u0435\u0440\u0432\u044b\u0439 \u0436\u0435 catch-\u0431\u043b\u043e\u043a). \u0414\u0430\u0432\u0430\u0439 \u0442\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 landing pad \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 catch-\u0431\u043b\u043e\u043a\u0430\u043c\u0438.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u043b\u0435\u0434\u0443\u044f \u043c\u043e\u0434\u0435 TDD (test driven development), \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043d\u0430\u0430\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0435\u0441\u0442 \u043d\u0430\u0448\u0435\u0433\u043e ABI. \u0423\u043b\u0443\u0447\u0448\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, throw.cpp, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e try\/catch \u0431\u043b\u043e\u043a\u043e\u0432:<\/p>\n<pre><code>#include &lt;stdio.h&gt; #include &quot;throw.h&quot;  struct Fake_Exception {};  void raise() {     throw Exception(); }  void try_but_dont_catch() {     try {         printf(&quot;Running a try which will never throw.\\n&quot;);     } catch(Fake_Exception&amp;) {         printf(&quot;Exception caught... with the wrong catch!\\n&quot;);     }      try {         raise();     } catch(Fake_Exception&amp;) {         printf(&quot;Caught a Fake_Exception!\\n&quot;);     }      printf(&quot;try_but_dont_catch handled the exception\\n&quot;); }  void catchit() {     try {         try_but_dont_catch();     } catch(Fake_Exception&amp;) {         printf(&quot;Caught a Fake_Exception!\\n&quot;);     } catch(Exception&amp;) {         printf(&quot;Caught an Exception!\\n&quot;);     }      printf(&quot;catchit handled the exception\\n&quot;); }  extern &quot;C&quot; {     void seppuku() {         catchit();     } }<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430? \u0421\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 try_but_dont_catch: \u043f\u0435\u0440\u0432\u044b\u0439 try\/catch \u0431\u043b\u043e\u043a \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442, \u043d\u0435 \u043e\u0442\u043b\u043e\u0432\u0438\u0432 \u0435\u0433\u043e. \u041f\u043e\u043a\u0443\u0434\u0430 \u043d\u0430\u0448 ABI \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0443\u043f\u043e\u0432\u0430\u0442, \u043f\u0435\u0440\u0432\u044b\u0439 catch-\u0431\u043b\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430. \u041d\u043e \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043f\u0435\u0440\u0432\u044b\u0439 catch? \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0441\u044f \u0441 \u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0439 catch\/try, \u044d\u0442\u043e \u043e\u043f\u044f\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u043f\u0435\u0440\u0435\u0434 \u0432\u0442\u043e\u0440\u044b\u043c try\/catch \u0431\u043b\u043e\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0435\u0433\u043e \u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b! \u0427\u0442\u043e \u0436, \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0439 while(true)!<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u043f\u043e\u043b\u044f\u0445 \u043d\u0430\u0447\u0430\u043b\u043e\/\u0434\u043b\u0438\u043d\u0430 (start\/length) \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 LSDA \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0430\u0448\u0435\u0433\u043e landing pad. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0431\u044b\u043b IP, \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0448\u0435\u043d\u043e, \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u0441 \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043d\u0430\u043c <em>Unwind<\/em> \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439: <strong>_Unwind_GetIP<\/strong>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e _Unwind_GetIP \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>void f1() {} void f2() { throw 1; } void f3() {}  void foo() { L1:     try{ f1(); } catch(...) {} L2:     try{ f2(); } catch(...) {} L3:     try{ f3(); } catch(...) {} }<\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u0448\u0430 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0432 catch-\u0431\u043b\u043e\u043a\u0435 \u0434\u043b\u044f f2, \u0430 \u0441\u0442\u044d\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>+------------------------------+ |   IP: f2  stack frame: f2    | +------------------------------+ |   IP: L3  stack frame: foo   | +------------------------------+<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e IP \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 L3, \u0445\u043e\u0442\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0432 L2. \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e IP \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430. \u042d\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0447\u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0443, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c IP \u0433\u0434\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e, \u0438\u043d\u0430\u0447\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437 _Unwind_GetIP \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 landing pad. \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code>_Unwind_Reason_Code __gxx_personality_v0 (                              int version,                              _Unwind_Action actions,                              uint64_t exceptionClass,                              _Unwind_Exception* unwind_exception,                              _Unwind_Context* context) {     if (actions &amp; _UA_SEARCH_PHASE)     {         printf(&quot;Personality function, lookup phase\\n&quot;);         return _URC_HANDLER_FOUND;     } else if (actions &amp; _UA_CLEANUP_PHASE) {         printf(&quot;Personality function, cleanup\\n&quot;);          \/\/ \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 -- \u043a\u0443\u0434\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b IP         \/\/ \u043f\u0440\u044f\u043c\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435         uintptr_t throw_ip = _Unwind_GetIP(context) - 1;          \/\/ \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u044b\u0440\u043e\u0439 LSDA         LSDA_ptr lsda = (uint8_t*)_Unwind_GetLanguageSpecificData(context);          \/\/ \u0427\u0442\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 LSDA         LSDA_Header header(&amp;lsda);          \/\/ \u0427\u0442\u0435\u043d\u0438\u0435 LSDA CS         LSDA_CS_Header cs_header(&amp;lsda);          \/\/ \u0420\u0430\u0441\u0441\u0447\u0435\u0442 \u043a\u043e\u043d\u0446\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b LSDA CS         const LSDA_ptr lsda_cs_table_end = lsda + cs_header.length;          \/\/ \u0426\u0438\u043a\u043b \u043f\u043e \u0432\u0441\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044f\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b CS         while (lsda &lt; lsda_cs_table_end)         {             LSDA_CS cs(&amp;lsda);              \/\/ \u0415\u0441\u043b\u0438 \u0442\u0443\u0442 \u043d\u0435\u0442 LP, \u043c\u044b \u0442\u0443\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0434\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435             if (not cs.lp) continue;              uintptr_t func_start = _Unwind_GetRegionStart(context);              \/\/ \u0420\u0430\u0441\u0447\u0435\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0433\u043e IP \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e lp             \/\/ \u0415\u0441\u043b\u0438 LP \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0442\u043e\u0433\u0434\u0430             \/\/ IP \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438             uintptr_t try_start = func_start + cs.start;             uintptr_t try_end = func_start + cs.start + cs.len;              \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430: \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043b\u0438 \u044d\u0442\u043e\u0442 LP \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e try \u0431\u043b\u043e\u043a\u0430             if (throw_ip &lt; try_start) continue;             if (throw_ip &gt; try_end) continue;              \/\/ \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0448\u043b\u0438 landing pad \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f; \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435             int r0 = __builtin_eh_return_data_regno(0);             int r1 = __builtin_eh_return_data_regno(1);              _Unwind_SetGR(context, r0, (uintptr_t)(unwind_exception));             \/\/ \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0437\u0430\u0448\u0438\u0442 \u0442\u0438\u043f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f;             \/\/ \u041c\u044b \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0436\u0435             _Unwind_SetGR(context, r1, (uintptr_t)(1));              _Unwind_SetIP(context, func_start + cs.lp);             break;         }          return _URC_INSTALL_CONTEXT;     } else {         printf(&quot;Personality function, error\\n&quot;);         return _URC_FATAL_PHASE1_ERROR;     } }  }<\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e: \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 <a href=\"https:\/\/github.com\/nicolasbrailo\/cpp_exception_handling_abi\/tree\/master\/abi_v07\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0449\u0435 \u0440\u0430\u0437 \u0438 \u0432\u043e\u0430\u043b\u044f! \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0446\u0438\u043a\u043b\u043e\u0432! \u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0438 \u043d\u0430\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 landing pad. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c \u0441\u0442\u044d\u0435\u043a\u0430 \u0432\u043c\u0435\u0441\u0442\u0430 \u043f\u0435\u0440\u0432\u043e\u0433\u043e.<\/p>\n<h1>C++ exceptions \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e catch-\u0431\u043b\u043e\u043a\u0430 \u0432 landing pad<\/h1>\n<p>  \u041c\u044b \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0431\u043e\u043b\u0435\u0435, \u0447\u0435\u043c \u043e\u0434\u043d\u0438\u043c landing pad. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u043b\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0438\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u2014 \u043a\u0430\u043a\u043e\u0439 catch-\u0431\u043b\u043e\u043a \u043d\u0430\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0431\u043b\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u2014 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0436\u0434\u0430\u043b\u0438 \u0447\u0435\u0433\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e? \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e:<\/p>\n<ul>\n<li>\u041f\u0435\u0440\u0432\u043e\u0435 \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435: \u0433\u0434\u0435 \u0438 \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u044d\u0442\u0438\u043c catch-\u0431\u043b\u043e\u043a\u043e\u043c.<\/li>\n<li>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0442\u0438\u043f catch, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c catch (&#8230;)?<\/li>\n<li>\u0414\u043b\u044f landing pad \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 catch-\u0431\u043b\u043e\u043a\u0430\u043c\u0438, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 catch \u0442\u0438\u043f\u044b?<\/li>\n<li>\u0412\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440:<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code> struct Base {};  struct Child : public Base {};  void foo() { throw Child; }   void bar()  {     try { foo(); }     catch(const Base&amp;){ ... }  }<\/code><\/pre>\n<p>  \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 Landing Pad \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043d\u043e \u0438 \u0432\u0441\u0435\u0445 \u0435\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439!<\/p>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0447\u0443\u0442\u044c \u043f\u0440\u043e\u0449\u0435: \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 landing pads \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0434\u043d\u0438\u043c catch \u0431\u043b\u043e\u043a\u043e\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b landing pad\u0430?<\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0442\u043e, \u044d\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0447\u0430\u0441\u0442\u0438 .gcc_except_table, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438: action table. \u0414\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u043d\u0430 throw.cpp \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043c, \u043f\u0440\u044f\u043c\u043e \u043f\u043e\u0441\u043b\u0435 call site table, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 &quot;try but dont catch&quot; \u0444\u0443\u043d\u043a\u0438\u0438:<\/p>\n<pre><code>LLSDACSE1:     .byte   0x1     .byte   0     .align 4     .long   _ZTI14Fake_Exception .LLSDATT1:<\/code><\/pre>\n<p>  \u041d\u0435 \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0442\u0443\u0442 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043d\u043e \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0435\u0449\u0430\u044e\u0449\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0447\u0442\u043e-\u0442\u043e, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 _ZTI14Fake_Exception:<\/p>\n<pre><code>_ZTI14Fake_Exception:     .long   _ZTVN10__cxxabiv117__class_type_infoE+8     .long   _ZTS14Fake_Exception     .weak   _ZTS9Exception     .section    .rodata._ZTS9Exception,&quot;aG&quot;,@progbits,_ZTS9Exception,comdat     .type   _ZTS9Exception, @object     .size   _ZTS9Exception, 11<\/code><\/pre>\n<p>  \u041c\u044b \u043d\u0430\u0448\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435! \u041c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u044d\u0442\u043e? \u042d\u0442\u043e std::type_info \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Fake_Exception!<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u043e? \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<h1>C++ exceptions \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f \u0442\u0438\u043f\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 .gcc_except_table<\/h1>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0433\u0434\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438, \u0447\u0438\u0442\u0430\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 .gcc_except_table; \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e landing pad. <\/p>\n<p>  \u041c\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0430\u0448\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e ABI \u0438 \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0438\u0441\u044c \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u0441\u0441\u0435\u0431\u043b\u0435\u0440\u0430 \u0434\u043b\u044f .gcc_except_table, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0442\u0438\u043f\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c. \u041c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0438\u043f\u043e\u0432 \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u043d\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u0411\u0443\u0434\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0444\u0430\u0437\u0435 \u043e\u0447\u0438\u0441\u0442\u043a\u0438, \u043d\u043e \u0441\u043f\u0435\u0440\u0432\u0430 \u0434\u0430\u0432\u0430\u0439 \u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e LSDA \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430:<\/p>\n<pre><code>struct LSDA_Header {     uint8_t start_encoding;     uint8_t type_encoding;      \/\/ \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u043a\u043e\u043d\u0446\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0434\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u0438\u043f\u043e\u0432     uint8_t type_table_offset; };<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441 \u043d\u043e\u0432\u043e\u0435: \u043e\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u0438\u043f\u043e\u0432. \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0442\u0430\u043a \u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0432\u044b\u0437\u043e\u0432\u043e\u0432:<\/p>\n<pre><code>struct LSDA_CS {     \/\/ \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u043a\u0443\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435     uint8_t start;     \/\/ \u0414\u043b\u0438\u043d\u0430 \u0431\u043b\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0430\u0442\u044c\u0441\u044f     uint8_t len;     \/\/ Landing pad     uint8_t lp;     \/\/ \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432 action table + 1 (0 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &quot;\u043d\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439&quot;)     uint8_t action; };<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u043e\u043b\u0435, &quot;action&quot;. \u042d\u0442\u043e \u2014 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432 action table. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0433\u043e CS (call site). \u0422\u0440\u044e\u043a \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f landing pads, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c catch-\u0431\u043b\u043e\u043a\u0438 \u0435\u0441\u0442\u044c, action \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0442\u0438\u043f\u043e\u0432, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432! \u0425\u0432\u0430\u0442\u0438\u0442 \u0440\u0430\u0437\u0433\u043b\u0430\u0433\u043e\u043b\u044c\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043a\u043e\u0434:<\/p>\n<pre><code>\/\/ \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0447\u0438\u0441\u0442\u043e\u0433\u043e LSDA LSDA_ptr lsda = (uint8_t*)_Unwind_GetLanguageSpecificData(context);  \/\/ \u0427\u0442\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 LSDA LSDA_Header header(&amp;lsda);  const LSDA_ptr types_table_start = lsda + header.type_table_offset;  \/\/ \u0427\u0442\u0435\u043d\u0438\u0435 LSDA CS LSDA_CS_Header cs_header(&amp;lsda);  \/\/ \u0420\u0430\u0441\u0441\u0447\u0435\u0442 \u043a\u043e\u043d\u0446\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b LSDA CS const LSDA_ptr lsda_cs_table_end = lsda + cs_header.length;  \/\/ \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u043b\u0430 action tables const LSDA_ptr action_tbl_start = lsda_cs_table_end;  \/\/ \u041f\u0435\u0440\u0432\u044b\u0439 call site LSDA_CS cs(&amp;lsda);  \/\/ cs.action -- \u044d\u0442\u043e offset + 1; \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c cs.action == 0 \/\/ \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0442\u0443\u0442 \u043d\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u043e\u0447\u0435\u043a \u0432\u0445\u043e\u0434\u0430 const size_t action_offset = cs.action - 1; const LSDA_ptr action = action_tbl_start + action_offset;  \/\/ \u0414\u043b\u044f landing pad \u0441 \u0431\u043b\u043e\u043a\u043e\u043c catch the action table \/\/ \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c index \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0438\u043f\u043e\u0432 int type_index = action[0];  \/\/ types_table_start \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043a\u043e\u043d\u0435\u0446 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \/\/ \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0432\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c type_index. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u0439\u0442\u0438 ptr \u043d\u0430 \/\/ std::type_info, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0432 \u043d\u0430\u0448\u0435\u043c catch-\u0431\u043b\u043e\u043a\u0435 const void* catch_type_info = types_table_start[ -1 * type_index ]; const std::type_info *catch_ti = (const std::type_info *) catch_type_info;  \/\/ \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430 Fake_Exception printf(&quot;%s\\n&quot;, catch_ti-&gt;name());<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0438\u0437-\u0437\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0439 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b type_info, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u043d \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e, \u043e\u043d \u043b\u0438\u0448\u044c \u0447\u0438\u0442\u0430\u0435\u0442 .gcc_except_table, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u043f\u0440\u0438 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0442\u0438\u043f\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u2014 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0448\u0430\u0433 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u0448\u0430 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0439. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0447\u0442\u0435\u043d\u0438\u044f LSDA \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043f\u0440\u044f\u0442\u0430\u043d\u044b \u043f\u043e\u0434 \u043a\u043e\u0432\u0440\u043e\u043c, \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u043c (\u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443 \u2014 \u0431\u044b\u0442\u044c \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u044b\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e). <\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0438\u043f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441 \u0442\u0438\u043f\u043e\u043c \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e.<\/p>\n<p>  C++ exceptions \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430 \u0441\u0442\u044d\u043a\u0430<\/p>\n<p>  \u041d\u0430\u0448\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u043d\u0430\u0435\u0442, \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442(\u043f\u0440\u0430\u0432\u0434\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e catch \u0431\u043b\u043e\u043a\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c try\/catch \u0431\u043b\u043e\u043a\u0435, \u043d\u0443 \u0438 \u0435\u0449\u0435 \u0431\u0435\u0437 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f), \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u2014 \u0441\u043f\u0435\u0440\u0432\u0430 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u043a \u0442\u043e\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0442\u0438\u043f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>__cxa_throw<\/strong>:<\/p>\n<pre><code>void __cxa_throw(void* thrown_exception,                  std::type_info *tinfo,                  void (*dest)(void*)) {     __cxa_exception *header = ((__cxa_exception *) thrown_exception - 1);      \/\/ \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0442\u0438\u043f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 _Unwind_     \/\/ \u0438\u043d\u0430\u0447\u0435 \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0438     header-&gt;exceptionType = tinfo;      _Unwind_RaiseException(&amp;header-&gt;unwindHeader); }<\/code><\/pre>\n<p>  \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0438\u043f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 (\u0438\u043c\u0435\u043d\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u2014 C++ \u0441\u0442\u0440\u043e\u043a\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e &quot;==&quot; \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e):<\/p>\n<pre><code>\/\/ \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0438\u043f\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f const void* catch_type_info = lsda.types_table_start[ -1 * type_index ]; const std::type_info *catch_ti = (const std::type_info *) catch_type_info;  \/\/ \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1; std::type_info *org_ex_type = exception_header-&amp;amp;gt;exceptionType;  printf(&quot;%s thrown, catch handles %s\\n&quot;,             org_ex_type-&gt;name(),             catch_ti-&gt;name());  \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c: \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 \u0442\u0438\u043f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \/\/ \u0441 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u043c if (org_ex_type-&gt;name() != catch_ti-&gt;name())     continue;<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/nicolasbrailo\/cpp_exception_handling_abi\/tree\/master\/abi_v09\">\u043d\u0430 \u0433\u0438\u0442\u0435 <\/a>\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0425\u043c, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0435\u0451 \u0441\u0430\u043c\u0438? \u0415\u0441\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u0444\u0430\u0437\u0430\u0445 \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043d\u043e\u0432\u0430. \u042f \u043d\u0435 \u0437\u043d\u0430\u044e, _Unwind \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u0435\u0439\u0441, \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u044f\u0434 \u2014 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>  \u041f\u043e\u043a\u0443\u0434\u0430 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 landing pad \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043c\u044b \u0432\u0440\u0430\u043b\u0438 <em>Unwind<\/em> \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u0432\u0441\u0435 \u0432 \u043d\u0430\u0448\u0435\u0439 ABI 9. \u041f\u0440\u0430\u0432\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c \u2014 \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0435\u0433\u043e. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c: \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430 \u0442\u043e\u0433\u043e:<\/p>\n<pre><code>_Unwind_Reason_Code __gxx_personality_v0 (...) {     printf(&quot;Personality function, searching for handler\\n&quot;);      \/\/ ...      foreach (call site entry in lsda)     {         if (call site entry.not_good()) continue;          \/\/  \u041c\u044b \u043d\u0430\u0448\u043b\u0438 landing pad \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f; \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435          \/\/ \u0415\u0441\u043b\u0438 \u043c\u044b \u0432 \u0444\u0430\u0437\u0435 \u043f\u043e\u0438\u0441\u043a\u0430, \u0433\u043e\u0432\u043e\u0440\u0438\u043c _Unwind_, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c         if (actions &amp; _UA_SEARCH_PHASE) return _URC_HANDLER_FOUND;          \/\/ \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0432 \u0444\u0430\u0437\u0435 \u043f\u043e\u0438\u0441\u043a\u0430, \u0442\u043e\u0433\u0434\u0430 \u0432 \u0444\u0430\u0437\u0435 _UA_CLEANUP_PHASE          \/* \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e *\/          return _URC_INSTALL_CONTEXT;     }      return _URC_CONTINUE_UNWIND; }<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e? \u041f\u0430\u0434\u0435\u043d\u0438\u0435! \u041a\u0442\u043e \u0431\u044b \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u043b\u0441\u044f. \u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u043d\u0430\u0448\u0443 \u043f\u0430\u0434\u0430\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e? \u0412\u043e\u0442 \u044d\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u043e\u0432\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>void catchit() {     try {         try_but_dont_catch();     } catch(Fake_Exception&amp;) {         printf(&quot;Caught a Fake_Exception!\\n&quot;);     } catch(Exception&amp;) {         printf(&quot;Caught an Exception!\\n&quot;);     }      printf(&quot;catchit handled the exception\\n&quot;); }<\/code><\/pre>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0430\u0448\u0430 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0438\u043f \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 landing pad \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c.\u0415\u0441\u043b\u0438 \u043c\u044b \u0443\u0434\u0430\u043b\u0438\u043c Fake_Exception catch-\u0431\u043b\u043e\u043a \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043d\u043e\u0432\u0430: \u0432\u0441\u0435 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e! \u041d\u0430\u0448\u0430 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 catch-\u0431\u043b\u043e\u043a \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0435, \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 try-catch \u0431\u043b\u043e\u043a\u043e\u043c \u0441 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c catch-\u0431\u043b\u043e\u043a\u043e\u043c.<\/p>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u043c \u0435\u0433\u043e \u0435\u0449\u0435 \u0440\u0430\u0437!<\/p>\n<h1>C++ exceptions \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 catch \u0438\u0437 landing pad<\/h1>\n<p>  19-\u044f \u0433\u043b\u0430\u0432\u0430 \u043e\u0431 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0445 \u0432 C++: \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c LSDA, \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 landing pad, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u044d\u043a \u0444\u0440\u0435\u0439\u043c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u043c\u0441\u044f \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0442\u0432\u0438 catch. \u0414\u043b\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0438\u043f\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0432\u043e \u0432\u0441\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 <strong>.gcc_except_table<\/strong>.<\/p>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435 action table? \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 catch-\u0431\u043b\u043e\u043a\u0430\u043c\u0438:<\/p>\n<pre><code># Call site table .LLSDACSB2:     # Call site 1     .uleb128 ip_range_start     .uleb128 ip_range_len     .uleb128 landing_pad_ip     .uleb128 (action_offset+1) =&gt; 0x3      # Rest of call site table  # Action table start .LLSDACSE2:     # Action 1     .byte   0x2     .byte   0      # Action 2     .byte   0x1     .byte   0x7d      .align 4     .long   _ZTI9Exception     .long   _ZTI14Fake_Exception .LLSDATT2: # Types table start<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 landing pad \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 (\u044d\u0442\u043e\u0442 LSDA \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 catchit, \u043a \u0441\u043b\u043e\u0432\u0443), \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0433\u043e:<\/p>\n<ul>\n<li>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u044d\u043a\u0448\u0435\u043d\u0430 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432 (\u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0442\u0435, \u043c\u044b \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c offset + 1, \u0430 0 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u2014 \u043d\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439)<\/li>\n<li>\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a action 2 \u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u0442\u0438\u043f\u0430 1. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0442\u0438\u043f\u043e\u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 (\u0442.\u0435. \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0435\u0451 \u043a\u043e\u043d\u0435\u0446 \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f -1 * index)<\/li>\n<li>\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 types_table[-1], \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c type_info \u0434\u043b\u044f Fake_Exception<\/li>\n<li>Fake_Exception \u043d\u0435 \u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e (action) (0x7d)<\/li>\n<li>\u0427\u0442\u0435\u043d\u0438\u0435 0x7d \u0432 uleb128 \u0432\u0435\u0440\u043d\u0443\u0442 -3, \u0447\u0442\u043e \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u043e\u0442\u043a\u0443\u0434\u0430 \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0435\u043c\u044f \u0448\u0430\u0433\u0430\u043c\u0438 \u043d\u0430\u0437\u0430\u0434<\/li>\n<li>\u0427\u0442\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 2<\/li>\n<li>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 type_info \u0434\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Exception, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c landing pad!<\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u043c, \u043f\u043e\u043a\u0443\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0441\u043d\u043e\u0432\u043e \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e\u0439 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/nicolasbrailo\/cpp_exception_handling_abi\/tree\/master\/abi_v11\">\u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>. \u041f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0431\u043e\u043d\u0443\u0441 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0443\u043c\u0435\u044e\u0449\u0435\u0439 \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0442\u0438\u043f\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u0430\u043a\u043e\u0439 catch-\u0431\u043b\u043e\u043a \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d (\u0435\u0441\u043b\u0438 \u0442\u0438\u043f \u2014 null, \u0431\u043b\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0440\u044f\u0434). \u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442: \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 C++ \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043a\u0430\u043a \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u0440\u0430\u0441\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u044d\u043a, \u043a\u0430\u043a \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c \u0441\u0442\u044d\u043a\u0430 \u0438 \u043a\u0430\u043a\u043e\u0439 catch \u0431\u043b\u043e\u043a \u0432\u043d\u0443\u0442\u0440\u0438 landing pad \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0437\u0430\u043f\u0443\u0441\u043a \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432. \u0427\u0442\u043e \u0436, \u0434\u0430\u043b\u0435\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 RAII.<\/p>\n<h1>C++ exceptions \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u0437\u0430\u043f\u0443\u0441\u043a \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0435<\/h1>\n<p>  \u041d\u0430\u0448 <a href=\"https:\/\/github.com\/nicolasbrailo\/cpp_exception_handling_abi\/tree\/master\/abi_v11\">\u043c\u0438\u043d\u0438-ABI 11 \u0432\u0435\u0440\u0441\u0438\u0438 <\/a>\u0443\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u043d\u043e \u043e\u043d \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434. \u041c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0435\u0441\u0442\u0440\u043a\u0443\u0442\u043e\u0440\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f .gcc_except_table, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e.<\/p>\n<pre><code># Call site table .LLSDACSB2:     # Call site 1     .uleb128 ip_range_start     .uleb128 ip_range_len     .uleb128 landing_pad_ip     .uleb128 (action_offset+1) =&gt; 0x3      # Rest of call site table  # Action table start .LLSDACSE2:     # Action 1     .byte   0     .byte   0      # Action 2     .byte   0x1     .byte   0x7d      .align 4     .long   _ZTI14Fake_Exception .LLSDATT2: # Types table start<\/code><\/pre>\n<p>  \u0412 \u043e\u0431\u044b\u0447\u043d\u043e\u043c landing pad, \u043a\u043e\u0433\u0434\u0430 action \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0435\u043c 0, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u0438\u043f\u043e\u0432 \u0438 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e catch \u0431\u043b\u043e\u043a\u0430. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0438\u043d\u0434\u0435\u043a\u0441 \u2014 0, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u043e\u0447\u0438\u0441\u0442\u043a\u0438. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 landing pad \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043e\u043d \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0438. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, landing pad \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0437\u0432\u0430\u0442\u044c _Unwind_Resume \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0438.<\/p>\n<p>  \u042f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u0432 <a href=\"https:\/\/github.com\/nicolasbrailo\/cpp_exception_handling_abi\/tree\/master\/abi_v12\">\u043c\u043e\u0439 \u0433\u0438\u0442\u0445\u0430\u0431 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a> \u043d\u043e\u0432\u0443\u044e \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u043e\u0434\u0430, \u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043b\u043e\u0445\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438: \u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u043d\u0430\u0448\u0435 \u0447\u0438\u0442\u0435\u0440\u0441\u0442\u0432\u043e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e uleb128 == char? \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432, \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 .gcc_except_table \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 (\u043f\u043e\u0434 &quot;\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438&quot; \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 127) \u0438 \u043d\u0430\u0448\u0430 \u0443\u043b\u043e\u0432\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u0435\u043b\u044c LSDA \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b uleb128 \u043a\u043e\u0434.<\/p>\n<p>  \u0414\u0430\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u043c\u044b \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0438 \u0441\u0432\u043e\u0435\u0433\u043e! \u041d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043c\u0438\u043d\u0438-ABI, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043f\u043e\u043c\u043e\u0449\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 libcxxabi!<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u043b\u0438\u043d\u043a\u0435\u0440\u0430\u043c\u0438. \u041c\u043e\u0436\u0435\u0442 \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0437\u0436\u0435&#8230;<\/p>\n<h1>C++ exceptions \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u0438\u0442\u043e\u0433\u0438<\/h1>\n<p>  \u041f\u043e\u0441\u043b\u0435 20-\u0442\u0438 \u0433\u043b\u0430\u0432 \u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u0442\u043e\u0433\u043e\u0432! \u0427\u0442\u043e \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u043a\u0430\u043a \u043e\u043d\u0438 \u043b\u043e\u0432\u044f\u0442\u0441\u044f?<\/p>\n<p>  \u041e\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u0447\u0442\u0435\u043d\u0438\u0438 .gcc_except_table, \u0447\u0442\u043e, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u044c:<\/p>\n<ul>\n<li>C++ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u0430\u0433\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 libstdc++<\/li>\n<li>\u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440:\n<ul>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 CFI \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0438 \u0441\u0442\u044d\u043a\u0430<\/li>\n<li>\u041e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0435 .gcc_except_table \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e landing pads (try\/catch \u0431\u043b\u043e\u043a\u0438). \u0427\u0430\u0441\u0442\u044c \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438.<\/li>\n<li>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0438\u0448\u0435\u043c throw, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e \u0432 \u043f\u0430\u0440\u0443 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 libstdc++, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0443<\/li>\n<\/ul>\n<p>  <\/li>\n<li>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435, __cxa_throw \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0443 \u0441\u0442\u044d\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 libstdc<\/li>\n<li>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0438 \u0441\u0442\u044d\u043a\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u0430\u044f libstdc++ (\u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, personality routine), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u0441\u0442\u044d\u043a\u0435, \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043e\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e catch-\u0431\u043b\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f std::terminate<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d \u2014 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0430 \u0441\u0442\u044d\u043a\u0430 \u0432\u043d\u043e\u0432\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u044d\u043a\u0430<\/li>\n<li>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0430<\/li>\n<li>\u041f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 .gcc_except_table \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0415\u0441\u043b\u0438 \u0432 \u043d\u0435\u0439 (\u0442\u0430\u0431\u043b\u0438\u0446\u0435) \u0435\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u043e\u0447\u0438\u0441\u0442\u043a\u0435, \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f &quot;\u043f\u0440\u044b\u0433\u0430\u0435\u0442&quot; \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0444\u0440\u0435\u0439\u043c \u0441\u0442\u044d\u043a\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430<\/li>\n<li>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u0447\u0438\u043a \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0444\u0440\u0435\u0439\u043c \u0441\u0442\u044d\u043a\u0430 (\u0441\u0447\u0438\u0442\u0430\u0439, \u0444\u0443\u043d\u043a\u0446\u0438\u044e), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043e\u043d \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 catch-\u0431\u043b\u043e\u043a<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f catch-\u0431\u043b\u043e\u043a\u0430, \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u0437\u0430\u043d\u044f\u0442\u0430\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c.<\/li>\n<\/ul>\n<p>  \u0418\u0437\u0443\u0447\u0438\u0432 \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u0445 \u0442\u043e, \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c exception safe \u043a\u043e\u0434.<\/p>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u043c \u0432\u0437\u0433\u043b\u044f\u0434\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043c\u0438\u043b\u044b\u043c\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u043e\u0438\u0442 \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0447\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435, \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043a\u0443\u0447\u0443 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u0430 \u0432 \u0441\u0435\u0431\u0435 (\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f), \u0447\u0442\u043e \u043d\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u043e \u0434\u043b\u044f C++ \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u044f\u0437\u044b\u043a\u0430\u0445 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430: \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0440\u0430\u0437\u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 if \u0438 switch \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u0421 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0441\u0435 \u0438\u043d\u0430\u0447\u0435: \u043a\u043e\u0434 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043f\u043e\u043b\u043d\u044f\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u044d\u043a, \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c landing pad, \u0441\u0442\u044d\u043a \u0440\u0430\u0441\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0432 \u0446\u0435\u043b\u043e\u043c, \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0433\u0438\u0438.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u2014 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u043b\u043e\u043c\u0430\u044e\u0442 \u043d\u0430\u0448\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u042d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430\u043c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0430 \u043b\u0438\u0448\u044c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0438\u043c\u0438!         <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/279149\/\"> https:\/\/habrahabr.ru\/post\/279149\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0432 C++<\/p>\n<p>  <a href=\"https:\/\/habrahabr.ru\/post\/279111\/\">1 \u0447\u0430\u0441\u0442\u044c<\/a><br \/>  <a href=\"https:\/\/habrahabr.ru\/post\/279151\/\">2 \u0447\u0430\u0441\u0442\u044c<\/a><\/p>\n<h1>C++ exceptions \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c: \u043f\u043e\u0438\u0441\u043a \u0432\u0435\u0440\u043d\u043e\u0433\u043e landing pad<\/h1>\n<p>  \u042d\u0442\u043e \u0443\u0436\u0435 15-\u044f \u0433\u043b\u0430\u0432\u0430 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438. \u041c\u044b \u0443\u0436\u0435 \u0438\u0437\u0443\u0447\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0438 \u0434\u0430\u0436\u0435 \u0438\u043c\u0435\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0439 \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f catch-\u0431\u043b\u043e\u043a (landing pad \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439). \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043e\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 landing pad (\u0442.\u0435. \u043f\u0435\u0440\u0432\u044b\u0439 \u0436\u0435 catch-\u0431\u043b\u043e\u043a). \u0414\u0430\u0432\u0430\u0439 \u0442\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 landing pad \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 catch-\u0431\u043b\u043e\u043a\u0430\u043c\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-276008","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/276008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=276008"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/276008\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=276008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=276008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=276008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}