sanitizer_flags.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //===-- sanitizer_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 ThreadSanitizer/AddressSanitizer runtime.
  9. //
  10. //===----------------------------------------------------------------------===//
  11. #ifndef SANITIZER_FLAGS_H
  12. #define SANITIZER_FLAGS_H
  13. #include "sanitizer_internal_defs.h"
  14. namespace __sanitizer {
  15. void ParseFlag(const char *env, bool *flag,
  16. const char *name, const char *descr);
  17. void ParseFlag(const char *env, int *flag,
  18. const char *name, const char *descr);
  19. void ParseFlag(const char *env, uptr *flag,
  20. const char *name, const char *descr);
  21. void ParseFlag(const char *env, const char **flag,
  22. const char *name, const char *descr);
  23. struct CommonFlags {
  24. bool symbolize;
  25. const char *external_symbolizer_path;
  26. bool allow_addr2line;
  27. const char *strip_path_prefix;
  28. bool fast_unwind_on_check;
  29. bool fast_unwind_on_fatal;
  30. bool fast_unwind_on_malloc;
  31. bool handle_ioctl;
  32. int malloc_context_size;
  33. const char *log_path;
  34. int verbosity;
  35. bool detect_leaks;
  36. bool leak_check_at_exit;
  37. bool allocator_may_return_null;
  38. bool print_summary;
  39. bool check_printf;
  40. bool handle_segv;
  41. bool allow_user_segv_handler;
  42. bool use_sigaltstack;
  43. bool detect_deadlocks;
  44. uptr clear_shadow_mmap_threshold;
  45. const char *color;
  46. bool legacy_pthread_cond;
  47. bool intercept_tls_get_addr;
  48. bool help;
  49. uptr mmap_limit_mb;
  50. bool coverage;
  51. bool coverage_direct;
  52. const char *coverage_dir;
  53. bool full_address_space;
  54. const char *suppressions;
  55. bool print_suppressions;
  56. bool disable_coredump;
  57. bool symbolize_inline_frames;
  58. const char *stack_trace_format;
  59. };
  60. inline CommonFlags *common_flags() {
  61. extern CommonFlags common_flags_dont_use;
  62. return &common_flags_dont_use;
  63. }
  64. void SetCommonFlagsDefaults(CommonFlags *f);
  65. void ParseCommonFlagsFromString(CommonFlags *f, const char *str);
  66. void PrintFlagDescriptions();
  67. } // namespace __sanitizer
  68. #endif // SANITIZER_FLAGS_H