2012-07-10 15:41:27 +08:00
|
|
|
//===-- asan_flags.h -------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of AddressSanitizer, an address sanity checker.
|
|
|
|
//
|
|
|
|
// ASan runtime flags.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef ASAN_FLAGS_H
|
|
|
|
#define ASAN_FLAGS_H
|
|
|
|
|
2013-01-30 21:12:08 +08:00
|
|
|
#include "sanitizer_common/sanitizer_internal_defs.h"
|
2015-01-15 23:13:43 +08:00
|
|
|
#include "sanitizer_common/sanitizer_flag_parser.h"
|
2012-07-10 15:41:27 +08:00
|
|
|
|
2013-02-19 21:14:48 +08:00
|
|
|
// ASan flag values can be defined in four ways:
|
2012-07-10 15:41:27 +08:00
|
|
|
// 1) initialized with default values at startup.
|
2013-02-19 21:14:48 +08:00
|
|
|
// 2) overriden during compilation of ASan runtime by providing
|
|
|
|
// compile definition ASAN_DEFAULT_OPTIONS.
|
|
|
|
// 3) overriden from string returned by user-specified function
|
2012-07-25 18:40:57 +08:00
|
|
|
// __asan_default_options().
|
2013-02-19 21:14:48 +08:00
|
|
|
// 4) overriden from env variable ASAN_OPTIONS.
|
2015-01-07 08:38:00 +08:00
|
|
|
// 5) overriden during ASan activation (for now used on Android only).
|
2012-07-10 15:41:27 +08:00
|
|
|
|
|
|
|
namespace __asan {
|
|
|
|
|
|
|
|
struct Flags {
|
2015-01-07 08:38:00 +08:00
|
|
|
#define ASAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
|
|
|
|
#include "asan_flags.inc"
|
|
|
|
#undef ASAN_FLAG
|
|
|
|
|
|
|
|
void SetDefaults();
|
2012-07-10 15:41:27 +08:00
|
|
|
};
|
2012-07-25 17:18:43 +08:00
|
|
|
|
2013-04-12 02:36:04 +08:00
|
|
|
extern Flags asan_flags_dont_use_directly;
|
|
|
|
inline Flags *flags() {
|
|
|
|
return &asan_flags_dont_use_directly;
|
|
|
|
}
|
2015-02-12 08:36:42 +08:00
|
|
|
|
|
|
|
void InitializeFlags();
|
2012-07-10 15:41:27 +08:00
|
|
|
|
|
|
|
} // namespace __asan
|
|
|
|
|
|
|
|
#endif // ASAN_FLAGS_H
|