diff options
author | Filipe Cabecinhas <me@filcab.net> | 2016-08-15 19:30:21 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2016-08-15 19:30:21 +0000 |
commit | 6682359e4a65e5eb8a6157e36f90b9410bf3f21e (patch) | |
tree | 129f1329797329a880670073648d0ed900457b54 /lib/asan/asan_descriptions.h | |
parent | 96ebe14bf1b7977bd2d87741687968560f20c9e9 (diff) | |
download | compiler-rt-6682359e4a65e5eb8a6157e36f90b9410bf3f21e.tar.gz |
Split DescribeAddressIfShadow between a function that gets all the information, and one that prints it.
Summary:
Replacement for part of D23518
This is the first patch to start reifying information about errors. It deals only with reifying shadow address-related information.
It will allow us to generate structures with all the relevant information for a given error so a debugger can get to them or they can be included in a core dump.
Reviewers: kcc, samsonov
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D23519
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_descriptions.h')
-rw-r--r-- | lib/asan/asan_descriptions.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/asan/asan_descriptions.h b/lib/asan/asan_descriptions.h new file mode 100644 index 000000000..c96fef953 --- /dev/null +++ b/lib/asan/asan_descriptions.h @@ -0,0 +1,37 @@ +//===-- asan_descriptions.h -------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of AddressSanitizer, an address sanity checker. +// +// ASan-private header for asan_descriptions.cc. +// TODO(filcab): Most struct definitions should move to the interface headers. +//===----------------------------------------------------------------------===// + +#include "sanitizer_common/sanitizer_common.h" + +namespace __asan { + +enum ShadowKind : u8 { + kShadowKindLow, + kShadowKindGap, + kShadowKindHigh, +}; +static const char *const ShadowNames[] = {"low shadow", "shadow gap", + "high shadow"}; + +struct ShadowAddressDescription { + uptr addr; + ShadowKind kind; + u8 shadow_byte; +}; + +bool GetShadowAddressInformation(uptr addr, ShadowAddressDescription *descr); +bool DescribeAddressIfShadow(uptr addr); + +} // namespace __asan |