1 //===-- sanitizer_mac.h -----------------------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is shared between various sanitizers' runtime libraries and
9 // provides definitions for OSX-specific functions.
10 //===----------------------------------------------------------------------===//
11 #ifndef SANITIZER_MAC_H
12 #define SANITIZER_MAC_H
14 #include "sanitizer_common.h"
15 #include "sanitizer_platform.h"
17 #include "sanitizer_posix.h"
19 namespace __sanitizer
{
21 struct MemoryMappingLayoutData
{
25 ModuleArch current_arch
;
26 u8 current_uuid
[kModuleUUIDSize
];
27 int current_load_cmd_count
;
28 char *current_load_cmd_addr
;
29 bool current_instrumented
;
33 MACOS_VERSION_UNINITIALIZED
= 0,
34 MACOS_VERSION_UNKNOWN
,
35 MACOS_VERSION_LEOPARD
,
36 MACOS_VERSION_SNOW_LEOPARD
,
38 MACOS_VERSION_MOUNTAIN_LION
,
39 MACOS_VERSION_MAVERICKS
,
40 MACOS_VERSION_YOSEMITE
,
41 MACOS_VERSION_UNKNOWN_NEWER
44 MacosVersion
GetMacosVersion();
48 void RestrictMemoryToMaxAddress(uptr max_address
);
50 } // namespace __sanitizer
53 static char __crashreporter_info_buff__
[__sanitizer::kErrorMessageBufferSize
] =
55 static const char *__crashreporter_info__
__attribute__((__used__
)) =
56 &__crashreporter_info_buff__
[0];
57 asm(".desc ___crashreporter_info__, 0x10");
60 namespace __sanitizer
{
61 static BlockingMutex
crashreporter_info_mutex(LINKER_INITIALIZED
);
63 INLINE
void CRAppendCrashLogMessage(const char *msg
) {
64 BlockingMutexLock
l(&crashreporter_info_mutex
);
65 internal_strlcat(__crashreporter_info_buff__
, msg
,
66 sizeof(__crashreporter_info_buff__
)); }
67 } // namespace __sanitizer
69 #endif // SANITIZER_MAC
70 #endif // SANITIZER_MAC_H