aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer/include
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-11-13 20:41:38 +0000
committerKostya Serebryany <kcc@gcc.gnu.org>2014-11-13 20:41:38 +0000
commitc5be964a423f952e2ec16e2152ae504639bf8f07 (patch)
tree5275c09e09235f15fe0ae824d5bbef4151a7d1f9 /libsanitizer/include
parent47bf94b79a5c4937a7f922c681fa556154dcb2d3 (diff)
downloadgcc-c5be964a423f952e2ec16e2152ae504639bf8f07.zip
gcc-c5be964a423f952e2ec16e2152ae504639bf8f07.tar.gz
gcc-c5be964a423f952e2ec16e2152ae504639bf8f07.tar.bz2
libsanitizer merge from upstream r221802
From-SVN: r217518
Diffstat (limited to 'libsanitizer/include')
-rw-r--r--libsanitizer/include/sanitizer/asan_interface.h28
-rw-r--r--libsanitizer/include/sanitizer/common_interface_defs.h2
2 files changed, 28 insertions, 2 deletions
diff --git a/libsanitizer/include/sanitizer/asan_interface.h b/libsanitizer/include/sanitizer/asan_interface.h
index d1d4529..023fa29 100644
--- a/libsanitizer/include/sanitizer/asan_interface.h
+++ b/libsanitizer/include/sanitizer/asan_interface.h
@@ -53,13 +53,39 @@ extern "C" {
// Otherwise returns 0.
int __asan_address_is_poisoned(void const volatile *addr);
- // If at least on byte in [beg, beg+size) is poisoned, return the address
+ // If at least one byte in [beg, beg+size) is poisoned, return the address
// of the first such byte. Otherwise return 0.
void *__asan_region_is_poisoned(void *beg, size_t size);
// Print the description of addr (useful when debugging in gdb).
void __asan_describe_address(void *addr);
+ // Useful for calling from a debugger to get information about an ASan error.
+ // Returns 1 if an error has been (or is being) reported, otherwise returns 0.
+ int __asan_report_present();
+
+ // Useful for calling from a debugger to get information about an ASan error.
+ // If an error has been (or is being) reported, the following functions return
+ // the pc, bp, sp, address, access type (0 = read, 1 = write), access size and
+ // bug description (e.g. "heap-use-after-free"). Otherwise they return 0.
+ void *__asan_get_report_pc();
+ void *__asan_get_report_bp();
+ void *__asan_get_report_sp();
+ void *__asan_get_report_address();
+ int __asan_get_report_access_type();
+ size_t __asan_get_report_access_size();
+ const char *__asan_get_report_description();
+
+ // Useful for calling from the debugger to get information about a pointer.
+ // Returns the category of the given pointer as a constant string.
+ // Possible return values are "global", "stack", "stack-fake", "heap",
+ // "heap-invalid", "shadow-low", "shadow-gap", "shadow-high", "unknown".
+ // If global or stack, tries to also return the variable name, address and
+ // size. If heap, tries to return the chunk address and size. 'name' should
+ // point to an allocated buffer of size 'name_size'.
+ const char *__asan_locate_address(void *addr, char *name, size_t name_size,
+ void **region_address, size_t *region_size);
+
// Useful for calling from the debugger to get the allocation stack trace
// and thread ID for a heap address. Stores up to 'size' frames into 'trace',
// returns the number of stored frames or 0 on error.
diff --git a/libsanitizer/include/sanitizer/common_interface_defs.h b/libsanitizer/include/sanitizer/common_interface_defs.h
index 43e0c30..3aba519 100644
--- a/libsanitizer/include/sanitizer/common_interface_defs.h
+++ b/libsanitizer/include/sanitizer/common_interface_defs.h
@@ -103,7 +103,7 @@ extern "C" {
const void *end,
const void *old_mid,
const void *new_mid);
- // Returns true if the contiguous container [beg, end) ir properly poisoned
+ // Returns true if the contiguous container [beg, end) is properly poisoned
// (e.g. with __sanitizer_annotate_contiguous_container), i.e. if
// - [beg, mid) is addressable,
// - [mid, end) is unaddressable.