#include "sanitizer_platform.h"
#if !SANITIZER_FUCHSIA
# include "sancov_flags.h"
# include "sanitizer_allocator_internal.h"
# include "sanitizer_atomic.h"
# include "sanitizer_common.h"
# include "sanitizer_common/sanitizer_stacktrace.h"
# include "sanitizer_file.h"
# include "sanitizer_interface_internal.h"
usingnamespace__sanitizer;
AddressRange;
namespace __sancov {
namespace {
static const u64 Magic64 = …;
static const u64 Magic32 = …;
static const u64 Magic = …;
static fd_t OpenFile(const char* path) { … }
static void GetCoverageFilename(char* path, const char* name,
const char* extension) { … }
static void WriteModuleCoverage(char* file_path, const char* module_name,
const uptr* pcs, uptr len) { … }
static void SanitizerDumpCoverage(const uptr* unsorted_pcs, uptr len) { … }
class TracePcGuardController { … };
static TracePcGuardController pc_guard_controller;
namespace SingletonCounterCoverage {
static char *counters_beg, *counters_end;
static const uptr *pcs_beg, *pcs_end;
static void DumpCoverage() { … }
static void Cov8bitCountersInit(char* beg, char* end) { … }
static void CovPcsInit(const uptr* beg, const uptr* end) { … }
}
}
}
namespace __sanitizer {
void InitializeCoverage(bool enabled, const char *dir) { … }
}
extern "C" {
SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_coverage(const uptr* pcs,
uptr len) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_pc_guard, u32* guard) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_pc_guard_init,
u32* start, u32* end) { … }
SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_trace_pc_guard_coverage() { … }
SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump() { … }
SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_reset() { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp1, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp2, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp4, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp8, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_const_cmp1, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_const_cmp2, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_const_cmp4, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_const_cmp8, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_switch, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_div4, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_div8, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_gep, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_pc_indir, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load1, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load2, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load4, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load8, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_load16, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store1, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store2, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store4, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store8, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_store16, void){ … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_8bit_counters_init,
char* start, char* end) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_bool_flag_init, void) { … }
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_pcs_init, const uptr* beg,
const uptr* end) { … }
}
#if !SANITIZER_APPLE && !SANITIZER_WINDOWS
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
thread_local uptr __sancov_lowest_stack;
#endif
#endif