summaryrefslogtreecommitdiff
path: root/include/sanitizer
diff options
context:
space:
mode:
Diffstat (limited to 'include/sanitizer')
-rw-r--r--include/sanitizer/common_interface_defs.h21
-rw-r--r--include/sanitizer/coverage_interface.h13
2 files changed, 26 insertions, 8 deletions
diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h
index 1c90a60d72c39..f9f93022353a5 100644
--- a/include/sanitizer/common_interface_defs.h
+++ b/include/sanitizer/common_interface_defs.h
@@ -117,6 +117,16 @@ extern "C" {
// Print the stack trace leading to this call. Useful for debugging user code.
void __sanitizer_print_stack_trace();
+ // Symbolizes the supplied 'pc' using the format string 'fmt'.
+ // Outputs at most 'out_buf_size' bytes into 'out_buf'.
+ // The format syntax is described in
+ // lib/sanitizer_common/sanitizer_stacktrace_printer.h.
+ void __sanitizer_symbolize_pc(void *pc, const char *fmt, char *out_buf,
+ size_t out_buf_size);
+ // Same as __sanitizer_symbolize_pc, but for data section (i.e. globals).
+ void __sanitizer_symbolize_global(void *data_ptr, const char *fmt,
+ char *out_buf, size_t out_buf_size);
+
// Sets the callback to be called right before death on error.
// Passing 0 will unset the callback.
void __sanitizer_set_death_callback(void (*callback)(void));
@@ -169,7 +179,16 @@ extern "C" {
// use-after-return detection.
void __sanitizer_start_switch_fiber(void **fake_stack_save,
const void *bottom, size_t size);
- void __sanitizer_finish_switch_fiber(void *fake_stack_save);
+ void __sanitizer_finish_switch_fiber(void *fake_stack_save,
+ const void **bottom_old,
+ size_t *size_old);
+
+ // Get full module name and calculate pc offset within it.
+ // Returns 1 if pc belongs to some module, 0 if module was not found.
+ int __sanitizer_get_module_and_offset_for_pc(void *pc, char *module_path,
+ size_t module_path_len,
+ void **pc_offset);
+
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/include/sanitizer/coverage_interface.h b/include/sanitizer/coverage_interface.h
index 2dcc09fc84993..b44c5acdee4bf 100644
--- a/include/sanitizer/coverage_interface.h
+++ b/include/sanitizer/coverage_interface.h
@@ -23,6 +23,11 @@ extern "C" {
void __sanitizer_cov_init();
// Record and dump coverage info.
void __sanitizer_cov_dump();
+
+ // Dump collected coverage info. Sorts pcs by module into individual
+ // .sancov files.
+ void __sanitizer_dump_coverage(const uintptr_t *pcs, uintptr_t len);
+
// Open <name>.sancov.packed in the coverage directory and return the file
// descriptor. Returns -1 on failure, or if coverage dumping is disabled.
// This is intended for use by sandboxing code.
@@ -41,13 +46,6 @@ extern "C" {
// Some of the entries in *data will be zero.
uintptr_t __sanitizer_get_coverage_guards(uintptr_t **data);
- // Set *data to the growing buffer with covered PCs and return the size
- // of the buffer. The entries are never zero.
- // When only unique pcs are collected, the size is equal to
- // __sanitizer_get_total_unique_coverage.
- // WARNING: EXPERIMENTAL API.
- uintptr_t __sanitizer_get_coverage_pc_buffer(uintptr_t **data);
-
// The coverage instrumentation may optionally provide imprecise counters.
// Rather than exposing the counter values to the user we instead map
// the counters to a bitset.
@@ -65,6 +63,7 @@ extern "C" {
// __sanitizer_get_number_of_counters bytes long and 8-aligned.
uintptr_t
__sanitizer_update_counter_bitset_and_clear_counters(uint8_t *bitset);
+
#ifdef __cplusplus
} // extern "C"
#endif