summaryrefslogtreecommitdiff
path: root/lib/hwasan/hwasan.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2019-06-27 23:16:13 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2019-06-27 23:16:13 +0000
commitde3285c6c57be31b1a67cc1e5fdbd485c6b373f6 (patch)
tree62413f6315b898a5e5d2314631eca0b728b711ae /lib/hwasan/hwasan.h
parent86555a91ea4243290620d034e0c200daba8de46f (diff)
downloadcompiler-rt-de3285c6c57be31b1a67cc1e5fdbd485c6b373f6.tar.gz
hwasan: Teach the runtime to identify the local variable being accessed in UAR reports.
Each function's PC is recorded in the ring buffer. From there we can access the function's local variables and reconstruct the tag of each one with the help of the information printed by llvm-symbolizer's new FRAME command. We can then find the variable that was likely being accessed by matching the pointer's tag against the reconstructed tag. Differential Revision: https://reviews.llvm.org/D63469 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@364607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/hwasan/hwasan.h')
-rw-r--r--lib/hwasan/hwasan.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/hwasan/hwasan.h b/lib/hwasan/hwasan.h
index 9cc9490a9..465e56c3a 100644
--- a/lib/hwasan/hwasan.h
+++ b/lib/hwasan/hwasan.h
@@ -44,6 +44,11 @@ const uptr kAddressTagMask = 0xFFUL << kAddressTagShift;
// for threads and stack histories. This is an ABI constant.
const unsigned kShadowBaseAlignment = 32;
+const unsigned kRecordAddrBaseTagShift = 3;
+const unsigned kRecordFPShift = 48;
+const unsigned kRecordFPLShift = 4;
+const unsigned kRecordFPModulus = 1 << (64 - kRecordFPShift + kRecordFPLShift);
+
static inline tag_t GetTagFromPointer(uptr p) {
return p >> kAddressTagShift;
}
@@ -93,9 +98,6 @@ void hwasan_free(void *ptr, StackTrace *stack);
void InstallTrapHandler();
void InstallAtExitHandler();
-const char *GetStackOriginDescr(u32 id, uptr *pc);
-const char *GetStackFrameDescr(uptr pc);
-
void EnterSymbolizer();
void ExitSymbolizer();
bool IsInSymbolizer();