asan_flags.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. #ifndef ASAN_FLAGS_H
  13. #define ASAN_FLAGS_H
  14. #include "sanitizer_common/sanitizer_internal_defs.h"
  15. // ASan flag values can be defined in four ways:
  16. // 1) initialized with default values at startup.
  17. // 2) overriden during compilation of ASan runtime by providing
  18. // compile definition ASAN_DEFAULT_OPTIONS.
  19. // 3) overriden from string returned by user-specified function
  20. // __asan_default_options().
  21. // 4) overriden from env variable ASAN_OPTIONS.
  22. namespace __asan {
  23. struct Flags {
  24. // Flag descriptions are in asan_rtl.cc.
  25. int quarantine_size;
  26. int redzone;
  27. int max_redzone;
  28. bool debug;
  29. int report_globals;
  30. bool check_initialization_order;
  31. bool replace_str;
  32. bool replace_intrin;
  33. bool mac_ignore_invalid_free;
  34. bool detect_stack_use_after_return;
  35. int min_uar_stack_size_log;
  36. int max_uar_stack_size_log;
  37. bool uar_noreserve;
  38. int max_malloc_fill_size, malloc_fill_byte;
  39. int exitcode;
  40. bool allow_user_poisoning;
  41. int sleep_before_dying;
  42. bool check_malloc_usable_size;
  43. bool unmap_shadow_on_exit;
  44. bool abort_on_error;
  45. bool print_stats;
  46. bool print_legend;
  47. bool atexit;
  48. bool allow_reexec;
  49. bool print_full_thread_history;
  50. bool poison_heap;
  51. bool poison_partial;
  52. bool poison_array_cookie;
  53. bool alloc_dealloc_mismatch;
  54. bool new_delete_type_mismatch;
  55. bool strict_memcmp;
  56. bool strict_init_order;
  57. bool start_deactivated;
  58. int detect_invalid_pointer_pairs;
  59. bool detect_container_overflow;
  60. int detect_odr_violation;
  61. bool dump_instruction_bytes;
  62. };
  63. extern Flags asan_flags_dont_use_directly;
  64. inline Flags *flags() {
  65. return &asan_flags_dont_use_directly;
  66. }
  67. void InitializeFlags(Flags *f, const char *env);
  68. } // namespace __asan
  69. #endif // ASAN_FLAGS_H