#include "sanitizer_common.h"
#include "sanitizer_flags.h"
#include "sanitizer_libc.h"
#include <stdio.h>
#include <stdarg.h>
#if SANITIZER_WINDOWS && defined(_MSC_VER) && _MSC_VER < 1800 && \
!defined(va_copy)
#define va_copy …
#endif
namespace __sanitizer {
static int AppendChar(char **buff, const char *buff_end, char c) { … }
static int AppendNumber(char **buff, const char *buff_end, u64 absolute_value,
u8 base, u8 minimal_num_length, bool pad_with_zero,
bool negative, bool uppercase) { … }
static int AppendUnsigned(char **buff, const char *buff_end, u64 num, u8 base,
u8 minimal_num_length, bool pad_with_zero,
bool uppercase) { … }
static int AppendSignedDecimal(char **buff, const char *buff_end, s64 num,
u8 minimal_num_length, bool pad_with_zero) { … }
static int AppendString(char **buff, const char *buff_end, int width,
int max_chars, const char *s) { … }
static int AppendPointer(char **buff, const char *buff_end, u64 ptr_value) { … }
int VSNPrintf(char *buff, int buff_length,
const char *format, va_list args) { … }
static void (*PrintfAndReportCallback)(const char *);
void SetPrintfAndReportCallback(void (*callback)(const char *)) { … }
#if SANITIZER_GO && defined(TSAN_EXTERNAL_HOOKS)
extern "C" void __sanitizer_on_print(const char *str);
#else
SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_on_print, const char *str) { … }
#endif
static void CallPrintfAndReportCallback(const char *str) { … }
static void NOINLINE SharedPrintfCodeNoBuffer(bool append_pid,
char *local_buffer,
int buffer_size,
const char *format,
va_list args) { … }
static void NOINLINE SharedPrintfCode(bool append_pid, const char *format,
va_list args) { … }
void Printf(const char *format, ...) { … }
void Report(const char *format, ...) { … }
int internal_snprintf(char *buffer, uptr length, const char *format, ...) { … }
void InternalScopedString::Append(const char *str) { … }
void InternalScopedString::AppendF(const char *format, ...) { … }
}