tools/android/bitmap_to_reached.py
def _DumpToOffsets(filename):
  """From a dump, returns a list of offsets in it.

  Args:
    filename: (str) Dump filename.

  Returns:
    ([int]) offsets in the dump, that is relative to .text start.
  """
  bitfield = None
  offsets = []
  with open(filename, 'r') as f:
    bitfield = f.read()
  assert len(bitfield) % SIZEOF_INT == 0
  count = len(bitfield) / SIZEOF_INT
  for i in xrange(count):
    entry = struct.unpack_from('<I', bitfield, offset=i * SIZEOF_INT)[0]
    for bit in range(BITS_IN_INT):
      if entry & (1 << bit):
        offsets.append((i * BITS_IN_INT + bit) * BYTES_GRANULARITY)
  return offsets
From a dump, returns a list of offsets in it.

  Args:
    filename: (str) Dump filename.

  Returns:
    ([int]) offsets in the dump, that is relative to .text start.
  
From a dump, returns a list of offsets in it.
From a dump returns a list of offsets in it .
def _DumpToOffsets(filename):
  bitfield = None
  offsets = []
  with open(filename, 'r') as f:
    bitfield = f.read()
  assert len(bitfield) % SIZEOF_INT == 0
  count = len(bitfield) / SIZEOF_INT
  for i in xrange(count):
    entry = struct.unpack_from('<I', bitfield, offset=i * SIZEOF_INT)[0]
    for bit in range(BITS_IN_INT):
      if entry & (1 << bit):
        offsets.append((i * BITS_IN_INT + bit) * BYTES_GRANULARITY)
  return offsets
def _DumpToOffsets ( filename ) : bitfield = None offsets = [ ] with open ( filename , 'r' ) as f : bitfield = f . read ( ) assert len ( bitfield ) % SIZEOF_INT == 0 count = len ( bitfield ) / SIZEOF_INT for i in xrange ( count ) : entry = struct . unpack_from ( '<I' , bitfield , offset = i * SIZEOF_INT ) [ 0 ] for bit in range ( BITS_IN_INT ) : if entry & ( 1 << bit ) : offsets . append ( ( i * BITS_IN_INT + bit ) * BYTES_GRANULARITY ) return offsets
From a dump, returns a list of offsets in it.
From a dump returns a list of offsets in it .
"""From a dump, returns a list of offsets in it.

  Args:
    filename: (str) Dump filename.

  Returns:
    ([int]) offsets in the dump, that is relative to .text start.
  """
([int]) offsets in the dump, that is relative to .text start.
( [ int ] ) offsets in the dump that is relative to . text start .
filename
(str) Dump filename.
( str ) Dump filename .