Revert "Revert "[sanitizers] Don't use Windows Trace Logging on MinGW""
This reverts my orignal revert in r355250, I misread the buildbot logs. Volodymyr's commit in r355244 fixed the build. llvm-svn: 355251
This commit is contained in:
parent
a75077bc73
commit
a8af6ca065
|
|
@ -804,7 +804,13 @@ enum AndroidApiLevel {
|
||||||
|
|
||||||
void WriteToSyslog(const char *buffer);
|
void WriteToSyslog(const char *buffer);
|
||||||
|
|
||||||
#if SANITIZER_MAC || SANITIZER_WINDOWS
|
#if defined(SANITIZER_WINDOWS) && defined(_MSC_VER)
|
||||||
|
#define SANITIZER_WIN_TRACE 1
|
||||||
|
#else
|
||||||
|
#define SANITIZER_WIN_TRACE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SANITIZER_MAC || SANITIZER_WIN_TRACE
|
||||||
void LogFullErrorReport(const char *buffer);
|
void LogFullErrorReport(const char *buffer);
|
||||||
#else
|
#else
|
||||||
INLINE void LogFullErrorReport(const char *buffer) {}
|
INLINE void LogFullErrorReport(const char *buffer) {}
|
||||||
|
|
@ -818,7 +824,7 @@ INLINE void WriteOneLineToSyslog(const char *s) {}
|
||||||
INLINE void LogMessageOnPrintf(const char *str) {}
|
INLINE void LogMessageOnPrintf(const char *str) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SANITIZER_LINUX || SANITIZER_WINDOWS
|
#if SANITIZER_LINUX || SANITIZER_WIN_TRACE
|
||||||
// Initialize Android logging. Any writes before this are silently lost.
|
// Initialize Android logging. Any writes before this are silently lost.
|
||||||
void AndroidLogInit();
|
void AndroidLogInit();
|
||||||
void SetAbortMessage(const char *);
|
void SetAbortMessage(const char *);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <psapi.h>
|
#include <psapi.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <TraceLoggingProvider.h>
|
|
||||||
|
|
||||||
#include "sanitizer_common.h"
|
#include "sanitizer_common.h"
|
||||||
#include "sanitizer_file.h"
|
#include "sanitizer_file.h"
|
||||||
|
|
@ -32,6 +31,8 @@
|
||||||
#if defined(PSAPI_VERSION) && PSAPI_VERSION == 1
|
#if defined(PSAPI_VERSION) && PSAPI_VERSION == 1
|
||||||
#pragma comment(lib, "psapi")
|
#pragma comment(lib, "psapi")
|
||||||
#endif
|
#endif
|
||||||
|
#if SANITIZER_WIN_TRACE
|
||||||
|
#include <traceloggingprovider.h>
|
||||||
// Windows trace logging provider init
|
// Windows trace logging provider init
|
||||||
#pragma comment(lib, "advapi32.lib")
|
#pragma comment(lib, "advapi32.lib")
|
||||||
TRACELOGGING_DECLARE_PROVIDER(g_asan_provider);
|
TRACELOGGING_DECLARE_PROVIDER(g_asan_provider);
|
||||||
|
|
@ -39,6 +40,9 @@ TRACELOGGING_DECLARE_PROVIDER(g_asan_provider);
|
||||||
TRACELOGGING_DEFINE_PROVIDER(g_asan_provider, "AddressSanitizerLoggingProvider",
|
TRACELOGGING_DEFINE_PROVIDER(g_asan_provider, "AddressSanitizerLoggingProvider",
|
||||||
(0x6c6c766d, 0x3846, 0x4e6a, 0xa4, 0xfb, 0x5b,
|
(0x6c6c766d, 0x3846, 0x4e6a, 0xa4, 0xfb, 0x5b,
|
||||||
0x53, 0x0b, 0xd0, 0xf3, 0xfa));
|
0x53, 0x0b, 0xd0, 0xf3, 0xfa));
|
||||||
|
#else
|
||||||
|
#define TraceLoggingUnregister(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
// A macro to tell the compiler that this part of the code cannot be reached,
|
// A macro to tell the compiler that this part of the code cannot be reached,
|
||||||
// if the compiler supports this feature. Since we're using this in
|
// if the compiler supports this feature. Since we're using this in
|
||||||
|
|
@ -1080,6 +1084,7 @@ u32 GetNumberOfCPUs() {
|
||||||
return sysinfo.dwNumberOfProcessors;
|
return sysinfo.dwNumberOfProcessors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SANITIZER_WIN_TRACE
|
||||||
// TODO(mcgov): Rename this project-wide to PlatformLogInit
|
// TODO(mcgov): Rename this project-wide to PlatformLogInit
|
||||||
void AndroidLogInit(void) {
|
void AndroidLogInit(void) {
|
||||||
HRESULT hr = TraceLoggingRegister(g_asan_provider);
|
HRESULT hr = TraceLoggingRegister(g_asan_provider);
|
||||||
|
|
@ -1103,6 +1108,7 @@ void LogFullErrorReport(const char *buffer) {
|
||||||
TraceLoggingValue(buffer, "AsanReportContents"));
|
TraceLoggingValue(buffer, "AsanReportContents"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // SANITIZER_WIN_TRACE
|
||||||
|
|
||||||
} // namespace __sanitizer
|
} // namespace __sanitizer
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue