asan_flags.h revision 1.1.1.3
1//===-- asan_flags.h -------------------------------------------*- C++ -*-===// 2// 3// This file is distributed under the University of Illinois Open Source 4// License. See LICENSE.TXT for details. 5// 6//===----------------------------------------------------------------------===// 7// 8// This file is a part of AddressSanitizer, an address sanity checker. 9// 10// ASan runtime flags. 11//===----------------------------------------------------------------------===// 12 13#ifndef ASAN_FLAGS_H 14#define ASAN_FLAGS_H 15 16#include "sanitizer_common/sanitizer_internal_defs.h" 17#include "sanitizer_common/sanitizer_flag_parser.h" 18 19// ASan flag values can be defined in four ways: 20// 1) initialized with default values at startup. 21// 2) overriden during compilation of ASan runtime by providing 22// compile definition ASAN_DEFAULT_OPTIONS. 23// 3) overriden from string returned by user-specified function 24// __asan_default_options(). 25// 4) overriden from env variable ASAN_OPTIONS. 26// 5) overriden during ASan activation (for now used on Android only). 27 28namespace __asan { 29 30struct Flags { 31#define ASAN_FLAG(Type, Name, DefaultValue, Description) Type Name; 32#include "asan_flags.inc" 33#undef ASAN_FLAG 34 35 void SetDefaults(); 36}; 37 38extern Flags asan_flags_dont_use_directly; 39inline Flags *flags() { 40 return &asan_flags_dont_use_directly; 41} 42 43void InitializeFlags(); 44 45} // namespace __asan 46 47#endif // ASAN_FLAGS_H 48