xref: /netbsd-src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_interface_internal.h (revision c38e7cc395b1472a774ff828e46123de44c628e9)
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.
13 //
14 // See also include/sanitizer/common_interface_defs.h
15 //===----------------------------------------------------------------------===//
16 #ifndef SANITIZER_INTERFACE_INTERNAL_H
17 #define SANITIZER_INTERFACE_INTERNAL_H
18 
19 #include "sanitizer_internal_defs.h"
20 
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 
27   typedef struct {
28       int coverage_sandboxed;
29       __sanitizer::sptr coverage_fd;
30       unsigned int coverage_max_block_size;
31   } __sanitizer_sandbox_arguments;
32 
33   // Notify the tools that the sandbox is going to be turned on.
34   SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void
35       __sanitizer_sandbox_on_notify(__sanitizer_sandbox_arguments *args);
36 
37   // This function is called by the tool when it has just finished reporting
38   // an error. 'error_summary' is a one-line string that summarizes
39   // the error message. This function can be overridden by the client.
40   SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
41   void __sanitizer_report_error_summary(const char *error_summary);
42 
43   SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump();
44   SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_init();
45   SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov(__sanitizer::u32 *guard);
46   SANITIZER_INTERFACE_ATTRIBUTE
47   void __sanitizer_annotate_contiguous_container(const void *beg,
48                                                  const void *end,
49                                                  const void *old_mid,
50                                                  const void *new_mid);
51   SANITIZER_INTERFACE_ATTRIBUTE
52   int __sanitizer_verify_contiguous_container(const void *beg, const void *mid,
53                                               const void *end);
54   SANITIZER_INTERFACE_ATTRIBUTE
55   const void *__sanitizer_contiguous_container_find_bad_address(
56       const void *beg, const void *mid, const void *end);
57   } // extern "C"
58 
59 #endif  // SANITIZER_INTERFACE_INTERNAL_H
60