diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-09-18 07:38:10 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-09-18 07:38:10 +0000 |
commit | 5c153faa535f671dd0e8d40ab43397f2d3c6f6f5 (patch) | |
tree | 4e71277a92400e49ff59ae2da785b92d4361d6d3 /lib/asan/asan_allocator.h | |
parent | c64b9994e45d04162a47f30343e4283c93464ab1 (diff) |
[ASan] Move printing descriptions of heap addresses in error report from allocator internals to asan_report.cc.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@164112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_allocator.h')
-rw-r--r-- | lib/asan/asan_allocator.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/asan/asan_allocator.h b/lib/asan/asan_allocator.h index c5e1aabbb..1c6c30b22 100644 --- a/lib/asan/asan_allocator.h +++ b/lib/asan/asan_allocator.h @@ -23,6 +23,26 @@ namespace __asan { static const uptr kNumberOfSizeClasses = 255; struct AsanChunk; +class AsanChunkView { + public: + explicit AsanChunkView(AsanChunk *chunk) : chunk_(chunk) {} + bool IsValid() { return chunk_ != 0; } + uptr Beg(); // first byte of user memory. + uptr End(); // last byte of user memory. + uptr UsedSize(); // size requested by the user. + uptr AllocTid(); + uptr FreeTid(); + void GetAllocStack(StackTrace *stack); + void GetFreeStack(StackTrace *stack); + bool AddrIsInside(uptr addr, uptr access_size, uptr *offset); + bool AddrIsAtLeft(uptr addr, uptr access_size, uptr *offset); + bool AddrIsAtRight(uptr addr, uptr access_size, uptr *offset); + private: + AsanChunk *const chunk_; +}; + +AsanChunkView FindHeapChunkByAddress(uptr address); + class AsanChunkFifoList { public: explicit AsanChunkFifoList(LinkerInitialized) { } |