[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
diff --git a/lib/asan/asan_allocator.h b/lib/asan/asan_allocator.h
index c5e1aab..1c6c30b 100644
--- a/lib/asan/asan_allocator.h
+++ b/lib/asan/asan_allocator.h
@@ -23,6 +23,26 @@
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) { }