asan_report.h revision e4bfca2b154a6ab4eda921aff454035f33f3551a
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.
11//
12// ASan-private header for error reporting functions.
13//===----------------------------------------------------------------------===//
14
15#include "asan_interface.h"
16#include "asan_internal.h"
17
18namespace __asan {
19
20// The following functions prints address description depending
21// on the memory type (shadow/heap/stack/global).
22void DescribeHeapAddress(uptr addr, uptr access_size);
23bool DescribeAddressIfGlobal(uptr addr);
24bool DescribeAddressRelativeToGlobal(uptr addr, const __asan_global &g);
25bool DescribeAddressIfShadow(uptr addr);
26bool DescribeAddressIfStack(uptr addr, uptr access_size);
27// Determines memory type on its own.
28void DescribeAddress(uptr addr, uptr access_size);
29
30// Different kinds of error reports.
31void NORETURN ReportSIGSEGV(uptr pc, uptr sp, uptr bp, uptr addr);
32
33void NORETURN ReportDoubleFree(uptr addr, AsanStackTrace *stack);
34void NORETURN ReportFreeNotMalloced(uptr addr, AsanStackTrace *stack);
35void NORETURN ReportMallocUsableSizeNotOwned(uptr addr,
36                                             AsanStackTrace *stack);
37void NORETURN ReportAsanGetAllocatedSizeNotOwned(uptr addr,
38                                                 AsanStackTrace *stack);
39void NORETURN ReportStringFunctionMemoryRangesOverlap(
40    const char *function, const char *offset1, uptr length1,
41    const char *offset2, uptr length2, AsanStackTrace *stack);
42
43}  // namespace __asan
44