#ifndef ASAN_INTERNAL_H
#define ASAN_INTERNAL_H
#include "asan_flags.h"
#include "asan_interface_internal.h"
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_internal_defs.h"
#include "sanitizer_common/sanitizer_libc.h"
#include "sanitizer_common/sanitizer_stacktrace.h"
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
# error \
"The AddressSanitizer run-time should not be instrumented by AddressSanitizer"
#endif
#ifndef ASAN_HAS_EXCEPTIONS
#define ASAN_HAS_EXCEPTIONS …
#endif
#ifndef ASAN_LOW_MEMORY
# if SANITIZER_IOS || SANITIZER_ANDROID
#define ASAN_LOW_MEMORY …
# else
#define ASAN_LOW_MEMORY …
# endif
#endif
#ifndef ASAN_DYNAMIC
# ifdef PIC
#define ASAN_DYNAMIC …
# else
#define ASAN_DYNAMIC …
# endif
#endif
namespace __asan {
class AsanThread;
StackTrace;
void AsanInitFromRtl();
bool TryAsanInitFromRtl();
void InitializePlatformExceptionHandlers();
bool IsSystemHeapAddress(uptr addr);
void PrintAddressSpaceLayout();
void NORETURN ShowStatsAndAbort();
void InitializeShadowMemory();
void ReplaceSystemMalloc();
uptr FindDynamicShadowStart();
void AsanCheckDynamicRTPrereqs();
void AsanCheckIncompatibleRT();
bool PlatformUnpoisonStacks();
void UnpoisonStack(uptr bottom, uptr top, const char *type);
AsanThread *CreateMainThread();
globals_op_fptr;
void AsanApplyToGlobals(globals_op_fptr op, const void *needle);
void AsanOnDeadlySignal(int, void *siginfo, void *context);
void SignContextStack(void *context);
void ReadContextStack(void *context, uptr *stack, uptr *ssize);
void StopInitOrderChecking();
void AsanTSDInit(void (*destructor)(void *tsd));
void *AsanTSDGet();
void AsanTSDSet(void *tsd);
void PlatformTSDDtor(void *tsd);
void AppendToErrorMessageBuffer(const char *buffer);
void *AsanDlSymNext(const char *sym);
bool HandleDlopenInit();
void InstallAtExitCheckLeaks();
void InstallAtForkHandler();
#define ASAN_ON_ERROR() …
bool AsanInited();
extern bool replace_intrin_cached;
extern void (*death_callback)(void);
const int kAsanHeapLeftRedzoneMagic = …;
const int kAsanHeapFreeMagic = …;
const int kAsanStackLeftRedzoneMagic = …;
const int kAsanStackMidRedzoneMagic = …;
const int kAsanStackRightRedzoneMagic = …;
const int kAsanStackAfterReturnMagic = …;
const int kAsanInitializationOrderMagic = …;
const int kAsanUserPoisonedMemoryMagic = …;
const int kAsanContiguousContainerOOBMagic = …;
const int kAsanStackUseAfterScopeMagic = …;
const int kAsanGlobalRedzoneMagic = …;
const int kAsanInternalHeapMagic = …;
const int kAsanArrayCookieMagic = …;
const int kAsanIntraObjectRedzone = …;
const int kAsanAllocaLeftMagic = …;
const int kAsanAllocaRightMagic = …;
static const uptr kCurrentStackFrameMagic = …;
static const uptr kRetiredStackFrameMagic = …;
}
#endif