(self, tcache_addr=None)
return result
Returns: tuple(chain, count) or None
Returns: tuple(chain, count) or None
Returns : tuple ( chain count ) or None
def tcachebins(self, tcache_addr=None):
        """Returns: tuple(chain, count) or None"""
        tcache = self.get_tcache(tcache_addr)

        if tcache is None:
            return

        counts = tcache['counts']
        entries = tcache['entries']

        num_tcachebins = entries.type.sizeof // entries.type.target().sizeof
        safe_lnk = pwndbg.glibc.check_safe_linking()

        def tidx2usize(idx):
            """Tcache bin index to chunk size, following tidx2usize macro in glibc malloc.c"""
            return idx * self.malloc_alignment + self.minsize - self.size_sz

        result = OrderedDict()
        for i in range(num_tcachebins):
            size = self._request2size(tidx2usize(i))
            count = int(counts[i])
            chain = pwndbg.chain.get(int(entries[i]), offset=self.tcache_next_offset, limit=heap_chain_limit, safe_linking=safe_lnk)

            result[size] = (chain, count)

        result['type'] = 'tcachebins'
        return result
def tcachebins ( self , tcache_addr = None ) : tcache = self . get_tcache ( tcache_addr ) if tcache is None : return counts = tcache [ 'counts' ] entries = tcache [ 'entries' ] num_tcachebins = entries . type . sizeof // entries . type . target ( ) . sizeof safe_lnk = pwndbg . glibc . check_safe_linking ( ) def tidx2usize ( idx ) : """Tcache bin index to chunk size, following tidx2usize macro in glibc malloc.c""" return idx * self . malloc_alignment + self . minsize - self . size_sz result = OrderedDict ( ) for i in range ( num_tcachebins ) : size = self . _request2size ( tidx2usize ( i ) ) count = int ( counts [ i ] ) chain = pwndbg . chain . get ( int ( entries [ i ] ) , offset = self . tcache_next_offset , limit = heap_chain_limit , safe_linking = safe_lnk ) result [ size ] = ( chain , count ) result [ 'type' ] = 'tcachebins' return result