Lines Matching refs:addr
71 static bool GetShadowKind(uptr addr, ShadowKind *shadow_kind) { in GetShadowKind() argument
72 CHECK(!AddrIsInMem(addr)); in GetShadowKind()
73 if (AddrIsInShadowGap(addr)) { in GetShadowKind()
75 } else if (AddrIsInHighShadow(addr)) { in GetShadowKind()
77 } else if (AddrIsInLowShadow(addr)) { in GetShadowKind()
85 bool DescribeAddressIfShadow(uptr addr) { in DescribeAddressIfShadow() argument
87 if (!GetShadowAddressInformation(addr, &descr)) return false; in DescribeAddressIfShadow()
92 bool GetShadowAddressInformation(uptr addr, ShadowAddressDescription *descr) { in GetShadowAddressInformation() argument
93 if (AddrIsInMem(addr)) return false; in GetShadowAddressInformation()
95 if (!GetShadowKind(addr, &shadow_kind)) return false; in GetShadowAddressInformation()
96 if (shadow_kind != kShadowKindGap) descr->shadow_byte = *(u8 *)addr; in GetShadowAddressInformation()
97 descr->addr = addr; in GetShadowAddressInformation()
104 AsanChunkView chunk, uptr addr, in GetAccessToHeapChunkInformation() argument
106 descr->bad_addr = addr; in GetAccessToHeapChunkInformation()
107 if (chunk.AddrIsAtLeft(addr, access_size, &descr->offset)) { in GetAccessToHeapChunkInformation()
109 } else if (chunk.AddrIsAtRight(addr, access_size, &descr->offset)) { in GetAccessToHeapChunkInformation()
115 } else if (chunk.AddrIsInside(addr, access_size, &descr->offset)) { in GetAccessToHeapChunkInformation()
126 static void PrintHeapChunkAccess(uptr addr, const ChunkAccess &descr) { in PrintHeapChunkAccess() argument
155 bool GetHeapAddressInformation(uptr addr, uptr access_size, in GetHeapAddressInformation() argument
157 AsanChunkView chunk = FindHeapChunkByAddress(addr); in GetHeapAddressInformation()
161 descr->addr = addr; in GetHeapAddressInformation()
162 GetAccessToHeapChunkInformation(&descr->chunk_access, chunk, addr, in GetHeapAddressInformation()
180 bool DescribeAddressIfHeap(uptr addr, uptr access_size) { in DescribeAddressIfHeap() argument
182 if (!GetHeapAddressInformation(addr, access_size, &descr)) { in DescribeAddressIfHeap()
193 bool GetStackAddressInformation(uptr addr, uptr access_size, in GetStackAddressInformation() argument
195 AsanThread *t = FindThreadByStackAddress(addr); in GetStackAddressInformation()
198 descr->addr = addr; in GetStackAddressInformation()
202 if (!t->GetStackFrameAccessByAddr(addr, &access)) { in GetStackAddressInformation()
223 static void PrintAccessAndVarIntersection(const StackVarDescr &var, uptr addr, in PrintAccessAndVarIntersection() argument
227 uptr addr_end = addr + access_size; in PrintAccessAndVarIntersection()
231 if (addr >= var.beg) { in PrintAccessAndVarIntersection()
234 else if (addr < var_end) in PrintAccessAndVarIntersection()
237 next_var_beg - addr_end >= addr - var_end) in PrintAccessAndVarIntersection()
242 else if (addr >= prev_var_end && addr - prev_var_end >= var.beg - addr_end) in PrintAccessAndVarIntersection()
261 d.Location(), addr, pos_descr, d.Default()); in PrintAccessAndVarIntersection()
268 bool DescribeAddressIfStack(uptr addr, uptr access_size) { in DescribeAddressIfStack() argument
270 if (!GetStackAddressInformation(addr, access_size, &descr)) return false; in DescribeAddressIfStack()
276 static void DescribeAddressRelativeToGlobal(uptr addr, uptr access_size, in DescribeAddressRelativeToGlobal() argument
281 if (addr < g.beg) { in DescribeAddressRelativeToGlobal()
282 str.AppendF("%p is located %zd bytes before", (void *)addr, g.beg - addr); in DescribeAddressRelativeToGlobal()
283 } else if (addr + access_size > g.beg + g.size) { in DescribeAddressRelativeToGlobal()
284 if (addr < g.beg + g.size) addr = g.beg + g.size; in DescribeAddressRelativeToGlobal()
285 str.AppendF("%p is located %zd bytes after", (void *)addr, in DescribeAddressRelativeToGlobal()
286 addr - (g.beg + g.size)); in DescribeAddressRelativeToGlobal()
289 str.AppendF("%p is located %zd bytes inside of", (void *)addr, in DescribeAddressRelativeToGlobal()
290 addr - g.beg); in DescribeAddressRelativeToGlobal()
301 bool GetGlobalAddressInformation(uptr addr, uptr access_size, in GetGlobalAddressInformation() argument
303 descr->addr = addr; in GetGlobalAddressInformation()
304 int globals_num = GetGlobalsForAddress(addr, descr->globals, descr->reg_sites, in GetGlobalAddressInformation()
311 bool DescribeAddressIfGlobal(uptr addr, uptr access_size, in DescribeAddressIfGlobal() argument
314 if (!GetGlobalAddressInformation(addr, access_size, &descr)) return false; in DescribeAddressIfGlobal()
321 Printf("Address %p is located in the %s area.\n", (void *)addr, in Print()
327 DescribeAddressRelativeToGlobal(addr, access_size, globals[i]); in Print()
346 a.beg <= addr && in PointsInsideTheSameVariable()
347 b.beg <= other.addr && in PointsInsideTheSameVariable()
348 (addr + access_size) < (a.beg + a.size) && in PointsInsideTheSameVariable()
349 (other.addr + other.access_size) < (b.beg + b.size)) in PointsInsideTheSameVariable()
360 Printf("Address %p is located in stack of thread %s", (void *)addr, in Print()
413 PrintHeapChunkAccess(addr, chunk_access); in Print()
439 AddressDescription::AddressDescription(uptr addr, uptr access_size, in AddressDescription() argument
441 if (GetShadowAddressInformation(addr, &data.shadow)) { in AddressDescription()
445 if (GetHeapAddressInformation(addr, access_size, &data.heap)) { in AddressDescription()
453 isStackMemory = GetStackAddressInformation(addr, access_size, &data.stack); in AddressDescription()
455 isStackMemory = GetStackAddressInformation(addr, access_size, &data.stack); in AddressDescription()
462 if (GetGlobalAddressInformation(addr, access_size, &data.global)) { in AddressDescription()
467 data.wild.addr = addr; in AddressDescription()
473 (void *)addr, (void *)access_size); in Print()
476 void PrintAddressDescription(uptr addr, uptr access_size, in PrintAddressDescription() argument
479 if (GetShadowAddressInformation(addr, &shadow_descr)) { in PrintAddressDescription()
485 if (GetGlobalAddressInformation(addr, access_size, &global_descr)) { in PrintAddressDescription()
491 if (GetStackAddressInformation(addr, access_size, &stack_descr)) { in PrintAddressDescription()
497 if (GetHeapAddressInformation(addr, access_size, &heap_descr)) { in PrintAddressDescription()