[SFN] sync up debug-only stmt list's side effects with empty stmts too
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_interface_internal.h
blob08c110c707c9a780b11ba4309c0159afdfb5c69b
1 //===-- sanitizer_interface_internal.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 shared between run-time libraries of sanitizers.
9 //
10 // This header declares the sanitizer runtime interface functions.
11 // The runtime library has to define these functions so the instrumented program
12 // could call them.
14 // See also include/sanitizer/common_interface_defs.h
15 //===----------------------------------------------------------------------===//
16 #ifndef SANITIZER_INTERFACE_INTERNAL_H
17 #define SANITIZER_INTERFACE_INTERNAL_H
19 #include "sanitizer_internal_defs.h"
21 extern "C" {
22 // Tell the tools to write their reports to "path.<pid>" instead of stderr.
23 // The special values are "stdout" and "stderr".
24 SANITIZER_INTERFACE_ATTRIBUTE
25 void __sanitizer_set_report_path(const char *path);
26 // Tell the tools to write their reports to the provided file descriptor
27 // (casted to void *).
28 SANITIZER_INTERFACE_ATTRIBUTE
29 void __sanitizer_set_report_fd(void *fd);
31 typedef struct {
32 int coverage_sandboxed;
33 __sanitizer::sptr coverage_fd;
34 unsigned int coverage_max_block_size;
35 } __sanitizer_sandbox_arguments;
37 // Notify the tools that the sandbox is going to be turned on.
38 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void
39 __sanitizer_sandbox_on_notify(__sanitizer_sandbox_arguments *args);
41 // This function is called by the tool when it has just finished reporting
42 // an error. 'error_summary' is a one-line string that summarizes
43 // the error message. This function can be overridden by the client.
44 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
45 void __sanitizer_report_error_summary(const char *error_summary);
47 SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump();
48 SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_coverage(
49 const __sanitizer::uptr *pcs, const __sanitizer::uptr len);
50 SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_trace_pc_guard_coverage();
52 SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov(__sanitizer::u32 *guard);
53 SANITIZER_INTERFACE_ATTRIBUTE
54 void __sanitizer_annotate_contiguous_container(const void *beg,
55 const void *end,
56 const void *old_mid,
57 const void *new_mid);
58 SANITIZER_INTERFACE_ATTRIBUTE
59 int __sanitizer_verify_contiguous_container(const void *beg, const void *mid,
60 const void *end);
61 SANITIZER_INTERFACE_ATTRIBUTE
62 const void *__sanitizer_contiguous_container_find_bad_address(
63 const void *beg, const void *mid, const void *end);
65 SANITIZER_INTERFACE_ATTRIBUTE
66 int __sanitizer_get_module_and_offset_for_pc(
67 __sanitizer::uptr pc, char *module_path,
68 __sanitizer::uptr module_path_len, __sanitizer::uptr *pc_offset);
70 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
71 void __sanitizer_cov_trace_cmp();
72 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
73 void __sanitizer_cov_trace_cmp1();
74 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
75 void __sanitizer_cov_trace_cmp2();
76 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
77 void __sanitizer_cov_trace_cmp4();
78 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
79 void __sanitizer_cov_trace_cmp8();
80 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
81 void __sanitizer_cov_trace_const_cmp1();
82 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
83 void __sanitizer_cov_trace_const_cmp2();
84 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
85 void __sanitizer_cov_trace_const_cmp4();
86 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
87 void __sanitizer_cov_trace_const_cmp8();
88 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
89 void __sanitizer_cov_trace_switch();
90 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
91 void __sanitizer_cov_trace_div4();
92 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
93 void __sanitizer_cov_trace_div8();
94 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
95 void __sanitizer_cov_trace_gep();
96 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
97 void __sanitizer_cov_trace_pc_indir();
98 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
99 void __sanitizer_cov_trace_pc_guard(__sanitizer::u32*);
100 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
101 void __sanitizer_cov_trace_pc_guard_init(__sanitizer::u32*,
102 __sanitizer::u32*);
103 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
104 void __sanitizer_cov_8bit_counters_init();
105 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
106 void __sanitizer_cov_pcs_init();
107 } // extern "C"
109 #endif // SANITIZER_INTERFACE_INTERNAL_H