]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.h
MFV r277658:
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / sanitizer_common / sanitizer_flags.h
1 //===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file is a part of ThreadSanitizer/AddressSanitizer runtime.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef SANITIZER_FLAGS_H
15 #define SANITIZER_FLAGS_H
16
17 #include "sanitizer_internal_defs.h"
18
19 namespace __sanitizer {
20
21 void ParseFlag(const char *env, bool *flag,
22     const char *name, const char *descr);
23 void ParseFlag(const char *env, int *flag,
24     const char *name, const char *descr);
25 void ParseFlag(const char *env, uptr *flag,
26     const char *name, const char *descr);
27 void ParseFlag(const char *env, const char **flag,
28     const char *name, const char *descr);
29
30 struct CommonFlags {
31   bool symbolize;
32   const char *external_symbolizer_path;
33   bool allow_addr2line;
34   const char *strip_path_prefix;
35   bool fast_unwind_on_check;
36   bool fast_unwind_on_fatal;
37   bool fast_unwind_on_malloc;
38   bool handle_ioctl;
39   int malloc_context_size;
40   const char *log_path;
41   int  verbosity;
42   bool detect_leaks;
43   bool leak_check_at_exit;
44   bool allocator_may_return_null;
45   bool print_summary;
46   bool check_printf;
47   bool handle_segv;
48   bool allow_user_segv_handler;
49   bool use_sigaltstack;
50   bool detect_deadlocks;
51   uptr clear_shadow_mmap_threshold;
52   const char *color;
53   bool legacy_pthread_cond;
54   bool intercept_tls_get_addr;
55   bool help;
56   uptr mmap_limit_mb;
57   bool coverage;
58   bool coverage_direct;
59   const char *coverage_dir;
60   bool full_address_space;
61   const char *suppressions;
62   bool print_suppressions;
63   bool disable_coredump;
64   bool symbolize_inline_frames;
65   const char *stack_trace_format;
66 };
67
68 inline CommonFlags *common_flags() {
69   extern CommonFlags common_flags_dont_use;
70   return &common_flags_dont_use;
71 }
72
73 void SetCommonFlagsDefaults(CommonFlags *f);
74 void ParseCommonFlagsFromString(CommonFlags *f, const char *str);
75 void PrintFlagDescriptions();
76
77 }  // namespace __sanitizer
78
79 #endif  // SANITIZER_FLAGS_H