Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(912)

Unified Diff: util/mach/mach_extensions.cc

Issue 1305893010: Don’t trigger EXC_CORPSE_NOTIFY on OS X 10.11 (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mach/mach_extensions.h ('k') | util/mach/mach_extensions_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/mach_extensions.cc
diff --git a/util/mach/mach_extensions.cc b/util/mach/mach_extensions.cc
index 63aae31d9ce92253c1df8b6a9bc2a265f3ba14e6..a3e147cc3bee2b01d7f5c5fab6eb639f52dfa7f2 100644
--- a/util/mach/mach_extensions.cc
+++ b/util/mach/mach_extensions.cc
@@ -44,18 +44,24 @@ exception_mask_t ExcMaskAll() {
// xnu-2422.110.17/osfmk/mach/ipc_tt.c.
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
- int mac_os_x_minor_version = MacOSXMinorVersion();
+ const int mac_os_x_minor_version = MacOSXMinorVersion();
#endif
// See 10.6.8 xnu-1504.15.3/osfmk/mach/exception_types.h. 10.7 uses the same
// definition as 10.6. See 10.7.5 xnu-1699.32.7/osfmk/mach/exception_types.h
const exception_mask_t kExcMaskAll_10_6 =
- EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION | EXC_MASK_ARITHMETIC |
- EXC_MASK_EMULATION | EXC_MASK_SOFTWARE | EXC_MASK_BREAKPOINT |
- EXC_MASK_SYSCALL | EXC_MASK_MACH_SYSCALL | EXC_MASK_RPC_ALERT |
+ EXC_MASK_BAD_ACCESS |
+ EXC_MASK_BAD_INSTRUCTION |
+ EXC_MASK_ARITHMETIC |
+ EXC_MASK_EMULATION |
+ EXC_MASK_SOFTWARE |
+ EXC_MASK_BREAKPOINT |
+ EXC_MASK_SYSCALL |
+ EXC_MASK_MACH_SYSCALL |
+ EXC_MASK_RPC_ALERT |
EXC_MASK_MACHINE;
-#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_7
- if (mac_os_x_minor_version <= 7) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
+ if (mac_os_x_minor_version < 8) {
return kExcMaskAll_10_6;
}
#endif
@@ -64,8 +70,8 @@ exception_mask_t ExcMaskAll() {
// xnu-2050.48.11/osfmk/mach/exception_types.h.
const exception_mask_t kExcMaskAll_10_8 =
kExcMaskAll_10_6 | EXC_MASK_RESOURCE;
-#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_8
- if (mac_os_x_minor_version <= 8) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
+ if (mac_os_x_minor_version < 9) {
return kExcMaskAll_10_8;
}
#endif
@@ -76,4 +82,18 @@ exception_mask_t ExcMaskAll() {
return kExcMaskAll_10_9;
}
+exception_mask_t ExcMaskValid() {
+ const exception_mask_t kExcMaskValid_10_6 = ExcMaskAll() | EXC_MASK_CRASH;
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
+ if (MacOSXMinorVersion() < 11) {
+ return kExcMaskValid_10_6;
+ }
+#endif
+
+ // 10.11 added EXC_MASK_CORPSE_NOTIFY. See 10.11 <mach/exception_types.h>.
+ const exception_mask_t kExcMaskValid_10_11 =
+ kExcMaskValid_10_6 | EXC_MASK_CORPSE_NOTIFY;
+ return kExcMaskValid_10_11;
+}
+
} // namespace crashpad
« no previous file with comments | « util/mach/mach_extensions.h ('k') | util/mach/mach_extensions_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698