Retro68/gcc/libsanitizer/sanitizer_common/sanitizer_mac.h

75 lines
2.1 KiB
C
Raw Normal View History

2015-08-28 15:33:40 +00:00
//===-- sanitizer_mac.h -----------------------------------------*- C++ -*-===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is shared between various sanitizers' runtime libraries and
// provides definitions for OSX-specific functions.
//===----------------------------------------------------------------------===//
#ifndef SANITIZER_MAC_H
#define SANITIZER_MAC_H
#include "sanitizer_common.h"
2015-08-28 15:33:40 +00:00
#include "sanitizer_platform.h"
#if SANITIZER_MAC
2017-04-10 11:32:00 +00:00
#include "sanitizer_posix.h"
2015-08-28 15:33:40 +00:00
namespace __sanitizer {
2018-12-28 15:30:48 +00:00
struct MemoryMappingLayoutData {
int current_image;
u32 current_magic;
u32 current_filetype;
ModuleArch current_arch;
u8 current_uuid[kModuleUUIDSize];
int current_load_cmd_count;
2019-06-02 15:48:37 +00:00
const char *current_load_cmd_addr;
2018-12-28 15:30:48 +00:00
bool current_instrumented;
};
2015-08-28 15:33:40 +00:00
enum MacosVersion {
MACOS_VERSION_UNINITIALIZED = 0,
MACOS_VERSION_UNKNOWN,
MACOS_VERSION_LEOPARD,
MACOS_VERSION_SNOW_LEOPARD,
MACOS_VERSION_LION,
MACOS_VERSION_MOUNTAIN_LION,
MACOS_VERSION_MAVERICKS,
MACOS_VERSION_YOSEMITE,
2019-06-02 15:48:37 +00:00
MACOS_VERSION_EL_CAPITAN,
MACOS_VERSION_SIERRA,
MACOS_VERSION_HIGH_SIERRA,
MACOS_VERSION_MOJAVE,
2017-04-10 11:32:00 +00:00
MACOS_VERSION_UNKNOWN_NEWER
2015-08-28 15:33:40 +00:00
};
MacosVersion GetMacosVersion();
2017-04-10 11:32:00 +00:00
char **GetEnviron();
2018-12-28 15:30:48 +00:00
void RestrictMemoryToMaxAddress(uptr max_address);
2015-08-28 15:33:40 +00:00
} // namespace __sanitizer
extern "C" {
static char __crashreporter_info_buff__[__sanitizer::kErrorMessageBufferSize] =
{};
static const char *__crashreporter_info__ __attribute__((__used__)) =
&__crashreporter_info_buff__[0];
asm(".desc ___crashreporter_info__, 0x10");
} // extern "C"
namespace __sanitizer {
static BlockingMutex crashreporter_info_mutex(LINKER_INITIALIZED);
INLINE void CRAppendCrashLogMessage(const char *msg) {
BlockingMutexLock l(&crashreporter_info_mutex);
internal_strlcat(__crashreporter_info_buff__, msg,
sizeof(__crashreporter_info_buff__)); }
} // namespace __sanitizer
2015-08-28 15:33:40 +00:00
#endif // SANITIZER_MAC
#endif // SANITIZER_MAC_H