| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "CrashHandler.h" | 8 #include "CrashHandler.h" |
| 9 | 9 |
| 10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 #elif defined(SK_CRASH_HANDLER) && defined(SK_BUILD_FOR_WIN) | 98 #elif defined(SK_CRASH_HANDLER) && defined(SK_BUILD_FOR_WIN) |
| 99 | 99 |
| 100 #include <DbgHelp.h> | 100 #include <DbgHelp.h> |
| 101 | 101 |
| 102 static const struct { | 102 static const struct { |
| 103 const char* name; | 103 const char* name; |
| 104 int code; | 104 const DWORD code; |
| 105 } kExceptions[] = { | 105 } kExceptions[] = { |
| 106 #define _(E) {#E, E} | 106 #define _(E) {#E, E} |
| 107 _(EXCEPTION_ACCESS_VIOLATION), | 107 _(EXCEPTION_ACCESS_VIOLATION), |
| 108 _(EXCEPTION_BREAKPOINT), | 108 _(EXCEPTION_BREAKPOINT), |
| 109 _(EXCEPTION_INT_DIVIDE_BY_ZERO), | 109 _(EXCEPTION_INT_DIVIDE_BY_ZERO), |
| 110 _(EXCEPTION_STACK_OVERFLOW), | 110 _(EXCEPTION_STACK_OVERFLOW), |
| 111 // TODO: more? | 111 // TODO: more? |
| 112 #undef _ | 112 #undef _ |
| 113 }; | 113 }; |
| 114 | 114 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 void SetupCrashHandler() { | 183 void SetupCrashHandler() { |
| 184 SetUnhandledExceptionFilter(handler); | 184 SetUnhandledExceptionFilter(handler); |
| 185 } | 185 } |
| 186 | 186 |
| 187 #else // We asked for SK_CRASH_HANDLER, but it's not Mac, Linux, or Windows
. Sorry! | 187 #else // We asked for SK_CRASH_HANDLER, but it's not Mac, Linux, or Windows
. Sorry! |
| 188 | 188 |
| 189 void SetupCrashHandler() { } | 189 void SetupCrashHandler() { } |
| 190 | 190 |
| 191 #endif | 191 #endif |
| 192 #endif // SK_CRASH_HANDLER | 192 #endif // SK_CRASH_HANDLER |
| OLD | NEW |