diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-15 21:51:01 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-15 21:51:01 +0000 |
commit | 3e46e8e63dd36f047305be5fbac592f8b5ba2c71 (patch) | |
tree | 592739170ec22a3ea8042c827c148a46bcd3d172 /base | |
parent | 94b555ee6cb66836bae146d9995aed6eb8c4a2c0 (diff) | |
download | chromium_src-3e46e8e63dd36f047305be5fbac592f8b5ba2c71.zip chromium_src-3e46e8e63dd36f047305be5fbac592f8b5ba2c71.tar.gz chromium_src-3e46e8e63dd36f047305be5fbac592f8b5ba2c71.tar.bz2 |
Crash on error or assert message in Debug build
r=rvargas
bug=102940
Review URL: http://codereview.chromium.org/8487004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/allocator/generic_allocators.cc | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/base/allocator/generic_allocators.cc b/base/allocator/generic_allocators.cc index 6ea36ec..25def96 100644 --- a/base/allocator/generic_allocators.cc +++ b/base/allocator/generic_allocators.cc @@ -105,13 +105,40 @@ void* _calloc_impl(size_t n, size_t size) { #undef malloc #undef free #undef calloc -int _CrtDbgReport(int, const char*, int, const char*, const char*, ...) { + +static int error_handler(int reportType) { + switch (reportType) { + case 0: // _CRT_WARN + __debugbreak(); + return 0; + + case 1: // _CRT_ERROR + __debugbreak(); + return 0; + + case 2: // _CRT_ASSERT + __debugbreak(); + return 0; + } + char* p = NULL; + *p = '\0'; return 0; } -int _CrtDbgReportW(int, const wchar_t*, int, const wchar_t*, - const wchar_t*, ...) { - return 0; +int _CrtDbgReport(int reportType, + const char*, + int, const char*, + const char*, + ...) { + return error_handler(reportType); +} + +int _CrtDbgReportW(int reportType, + const wchar_t*, + int, const wchar_t*, + const wchar_t*, + ...) { + return error_handler(reportType); } int _CrtSetReportMode(int, int) { |