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"
|
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.
|
2012-07-10 15:41:27 +08:00
|
|
|
|
|
|
|
namespace __asan {
|
|
|
|
|
|
|
|
struct Flags {
|
2014-03-21 16:37:59 +08:00
|
|
|
// Flag descriptions are in asan_rtl.cc.
|
2012-07-10 15:41:27 +08:00
|
|
|
int quarantine_size;
|
|
|
|
int redzone;
|
2014-01-09 22:41:03 +08:00
|
|
|
int max_redzone;
|
2012-07-10 15:41:27 +08:00
|
|
|
bool debug;
|
|
|
|
int report_globals;
|
2012-08-21 22:10:25 +08:00
|
|
|
bool check_initialization_order;
|
2012-07-10 15:41:27 +08:00
|
|
|
bool replace_str;
|
|
|
|
bool replace_intrin;
|
|
|
|
bool mac_ignore_invalid_free;
|
2013-09-18 18:35:12 +08:00
|
|
|
bool detect_stack_use_after_return;
|
2013-12-16 16:42:08 +08:00
|
|
|
int min_uar_stack_size_log;
|
|
|
|
int max_uar_stack_size_log;
|
2013-12-13 23:03:49 +08:00
|
|
|
bool uar_noreserve;
|
2013-04-04 19:17:14 +08:00
|
|
|
int max_malloc_fill_size, malloc_fill_byte;
|
2012-07-10 15:41:27 +08:00
|
|
|
int exitcode;
|
|
|
|
bool allow_user_poisoning;
|
|
|
|
int sleep_before_dying;
|
|
|
|
bool check_malloc_usable_size;
|
|
|
|
bool unmap_shadow_on_exit;
|
|
|
|
bool abort_on_error;
|
2013-01-28 15:34:22 +08:00
|
|
|
bool print_stats;
|
|
|
|
bool print_legend;
|
2012-07-10 15:41:27 +08:00
|
|
|
bool atexit;
|
|
|
|
bool disable_core;
|
2012-08-24 17:22:05 +08:00
|
|
|
bool allow_reexec;
|
2012-09-05 15:37:15 +08:00
|
|
|
bool print_full_thread_history;
|
2012-12-20 19:54:21 +08:00
|
|
|
bool poison_heap;
|
2013-10-16 21:49:01 +08:00
|
|
|
bool poison_partial;
|
2012-12-21 16:53:59 +08:00
|
|
|
bool alloc_dealloc_mismatch;
|
2014-07-30 17:48:23 +08:00
|
|
|
bool new_delete_size_mismatch;
|
2013-02-28 22:09:30 +08:00
|
|
|
bool strict_memcmp;
|
2013-04-19 16:35:16 +08:00
|
|
|
bool strict_init_order;
|
2014-01-16 20:31:50 +08:00
|
|
|
bool start_deactivated;
|
2014-02-27 20:45:36 +08:00
|
|
|
int detect_invalid_pointer_pairs;
|
2014-04-21 22:18:45 +08:00
|
|
|
bool detect_container_overflow;
|
2014-04-28 20:47:58 +08:00
|
|
|
int detect_odr_violation;
|
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;
|
|
|
|
}
|
2012-07-10 15:41:27 +08:00
|
|
|
void InitializeFlags(Flags *f, const char *env);
|
|
|
|
|
|
|
|
} // namespace __asan
|
|
|
|
|
|
|
|
#endif // ASAN_FLAGS_H
|