[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.
[blocksruntime.git] / lib / asan / asan_report.h
blob84111b163ad73ee3f8d01a0215d9ce5205b4020b
1 //===-- asan_report.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 AddressSanitizer, an address sanity checker.
12 // ASan-private header for error reporting functions.
13 //===----------------------------------------------------------------------===//
15 #include "asan_allocator.h"
16 #include "asan_internal.h"
17 #include "asan_thread.h"
19 namespace __asan {
21 // The following functions prints address description depending
22 // on the memory type (shadow/heap/stack/global).
23 void DescribeHeapAddress(uptr addr, uptr access_size);
24 bool DescribeAddressIfGlobal(uptr addr, uptr access_size);
25 bool DescribeAddressRelativeToGlobal(uptr addr, uptr access_size,
26 const __asan_global &g);
27 bool DescribeAddressIfShadow(uptr addr);
28 bool DescribeAddressIfStack(uptr addr, uptr access_size);
29 // Determines memory type on its own.
30 void DescribeAddress(uptr addr, uptr access_size);
32 void DescribeThread(AsanThreadContext *context);
34 // Different kinds of error reports.
35 void NORETURN
36 ReportStackOverflow(uptr pc, uptr sp, uptr bp, void *context, uptr addr);
37 void NORETURN
38 ReportSIGSEGV(uptr pc, uptr sp, uptr bp, void *context, uptr addr);
39 void NORETURN ReportDoubleFree(uptr addr, StackTrace *free_stack);
40 void NORETURN ReportFreeNotMalloced(uptr addr, StackTrace *free_stack);
41 void NORETURN ReportAllocTypeMismatch(uptr addr, StackTrace *free_stack,
42 AllocType alloc_type,
43 AllocType dealloc_type);
44 void NORETURN ReportMallocUsableSizeNotOwned(uptr addr,
45 StackTrace *stack);
46 void NORETURN ReportAsanGetAllocatedSizeNotOwned(uptr addr,
47 StackTrace *stack);
48 void NORETURN ReportStringFunctionMemoryRangesOverlap(
49 const char *function, const char *offset1, uptr length1,
50 const char *offset2, uptr length2, StackTrace *stack);
51 void NORETURN
52 ReportBadParamsToAnnotateContiguousContainer(uptr beg, uptr end, uptr old_mid,
53 uptr new_mid, StackTrace *stack);
55 // Mac-specific errors and warnings.
56 void WarnMacFreeUnallocated(
57 uptr addr, uptr zone_ptr, const char *zone_name, StackTrace *stack);
58 void NORETURN ReportMacMzReallocUnknown(
59 uptr addr, uptr zone_ptr, const char *zone_name, StackTrace *stack);
60 void NORETURN ReportMacCfReallocUnknown(
61 uptr addr, uptr zone_ptr, const char *zone_name, StackTrace *stack);
63 } // namespace __asan