Author: ivan Date: Wed Jul 24 12:00:51 2013 New Revision: 1506507 URL: http://svn.apache.org/r1506507 Log: On Windows add SVN_CMDLINE_DISABLE_CRASH_HANDLER environment variable to disable crash handler. Useful for debugging crashing command line client.
* subversion/libsvn_subr/cmdline.c (svn_cmdline_init): Do not set crash handler if SVN_CMDLINE_DISABLE_CRASH_HANDLER environment variable set. Modified: subversion/trunk/subversion/libsvn_subr/cmdline.c Modified: subversion/trunk/subversion/libsvn_subr/cmdline.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cmdline.c?rev=1506507&r1=1506506&r2=1506507&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_subr/cmdline.c (original) +++ subversion/trunk/subversion/libsvn_subr/cmdline.c Wed Jul 24 12:00:51 2013 @@ -131,30 +131,32 @@ svn_cmdline_init(const char *progname, F #endif /* _MSC_VER < 1400 */ #ifdef SVN_USE_WIN32_CRASHHANDLER - /* Attach (but don't load) the crash handler */ - SetUnhandledExceptionFilter(svn__unhandled_exception_filter); + if (!getenv("SVN_CMDLINE_DISABLE_CRASH_HANDLER")) + { + /* Attach (but don't load) the crash handler */ + SetUnhandledExceptionFilter(svn__unhandled_exception_filter); #if _MSC_VER >= 1400 - /* ### This should work for VC++ 2002 (=1300) and later */ - /* Show the abort message on STDERR instead of a dialog to allow - scripts (e.g. our testsuite) to continue after an abort without - user intervention. Allow overriding for easier debugging. */ - if (!getenv("SVN_CMDLINE_USE_DIALOG_FOR_ABORT")) - { - /* In release mode: Redirect abort() errors to stderr */ - _set_error_mode(_OUT_TO_STDERR); - - /* In _DEBUG mode: Redirect all debug output (E.g. assert() to stderr. - (Ignored in release builds) */ - _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR); - _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR); - _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR); - _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); - _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); - } -#endif /* _MSC_VER >= 1400 */ + /* ### This should work for VC++ 2002 (=1300) and later */ + /* Show the abort message on STDERR instead of a dialog to allow + scripts (e.g. our testsuite) to continue after an abort without + user intervention. Allow overriding for easier debugging. */ + if (!getenv("SVN_CMDLINE_USE_DIALOG_FOR_ABORT")) + { + /* In release mode: Redirect abort() errors to stderr */ + _set_error_mode(_OUT_TO_STDERR); + /* In _DEBUG mode: Redirect all debug output (E.g. assert() to stderr. + (Ignored in release builds) */ + _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR); + _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR); + _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR); + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + } +#endif /* _MSC_VER >= 1400 */ + } #endif /* SVN_USE_WIN32_CRASHHANDLER */ #endif /* WIN32 */