简体   繁体   English

C ++故障转储,在Win32异常上展开堆栈(使用catch(…)时)-VS 2003

[英]C++ crash dump, stack unwinding on Win32 exceptions (when catch(…) used) - VS 2003

Like in Just In Time debugging, does VS 2003 compiled apps catch Win32 (or asynchronous) exceptions in a catch (...) and unwind the stack? 像在即时调试中一样,VS 2003编译的应用程序是否在捕获(...)中捕获Win32(或异步)异常并展开堆栈? before the dump file is written... 在写入转储文件之前...

No, the debugger invocation is created in code that runs UP the stack from the exception, so the stack has not yet unwind. 否,调试器调用是在代码中创建的,该代码从异常向上运行堆栈,因此堆栈尚未展开。 That is true for both sync (C++)and async (OS) exception. 对于同步(C ++)和异步(OS)异常都是如此。

See the Fig. 13 in the famous MSJ article A Crash Course on the Depths of Win32™ Structured Exception Handling . 请参见著名的MSJ文章“关于Win32™结构化异常处理的深度的崩溃课程”中图13

The unhandled exception filter is invoked after the first pass of the exception filter list, if no filter admitted that is willing to handle the exception. 未处理的异常过滤器异常过滤器列表的第一遍后调用,如果没有过滤坦言,愿意来处理异常。 This first pass is before the unwinding, which occurs on the second pass. 此第一遍在展开之前,第二遍发生。 If you break into the debugger when given a chance you'll find your exception place down your stack, and that makes perfect sense: it would give little to no value to debug a stack that had already unwound, you would have no idea what went wrong. 如果你有机会,你会发现你的异常的地方下来的筹码时中断到调试,这使得完美的意义:它将没有价值给小调试堆栈就已经解开,你根本不知道什么地方错误。

This depends on stack unwind semantics choosen when compiling your application Compiler can be instructed to catch or not to catch SEH exceptions for your code. 这取决于在编译应用程序时选择的堆栈展开语义。可以指示编译器捕获或不捕获代码的SEH异常。 Startup code always catches C++ & SEH exceptions and if any exception is caught it terminates the application. 启动代码始终捕获C ++和SEH异常,如果捕获到任何异常,它将终止应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM