2012-07-10 15:41:27 +08:00
|
|
|
//===-- asan_flags.h -------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-07-10 15:41:27 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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
|