tools/mac/symbolicate_crash.py
def _ParseBinaryImages(self, fd):
    """Parses out the binary images section in order to get the load offset."""
    # The parser skips some sections, so advance until the "Binary Images"
    # header is reached.
    while not fd.readline().lstrip().startswith("Binary Images:"): pass

    # Create a regex to match the lines of format:
    # |0x<start> - 0x<end> <binary-image> <version> (<version>) <<UUID>> <path>|
    image_re = re.compile(
        '[ ]*(0x[0-9a-f]+) -[ \t]+(0x[0-9a-f]+) [+ ]([a-zA-Z0-9._\-]+)')

    # This section is in this format:
    # |<start address> - <end address> <image name>|.
    while True:
      line = fd.readline()
      if not line.strip():
        # End when a blank line is hit.
        return
      # Match the line to the regex.
      match = image_re.match(line)
      if match:
        # Store the offsets by image name so it can be referenced during
        # symbolication. These are hex numbers with leading '0x', so int() can
        # convert them to decimal if base=0.
        address_range = (int(match.group(1), 0), int(match.group(2), 0))
        self._binary_images[match.group(3)] = address_range
Parses out the binary images section in order to get the load offset.
Parses out the binary images section in order to get the load offset.
Parses out the binary images section in order to get the load offset .
def _ParseBinaryImages(self, fd):
    while not fd.readline().lstrip().startswith("Binary Images:"): pass
    image_re = re.compile(
        '[ ]*(0x[0-9a-f]+) -[ \t]+(0x[0-9a-f]+) [+ ]([a-zA-Z0-9._\-]+)')
    while True:
      line = fd.readline()
      if not line.strip():
        return
      match = image_re.match(line)
      if match:
        address_range = (int(match.group(1), 0), int(match.group(2), 0))
        self._binary_images[match.group(3)] = address_range
def _ParseBinaryImages ( self , fd ) : while not fd . readline ( ) . lstrip ( ) . startswith ( "Binary Images:" ) : pass image_re = re . compile ( '[ ]*(0x[0-9a-f]+) -[ \t]+(0x[0-9a-f]+) [+ ]([a-zA-Z0-9._\-]+)' ) while True : line = fd . readline ( ) if not line . strip ( ) : return match = image_re . match ( line ) if match : address_range = ( int ( match . group ( 1 ) , 0 ) , int ( match . group ( 2 ) , 0 ) ) self . _binary_images [ match . group ( 3 ) ] = address_range
Parses out the binary images section in order to get the load offset.
Parses out the binary images section in order to get the load offset .
"""Parses out the binary images section in order to get the load offset.""" # The parser skips some sections, so advance until the "Binary Images" # header is reached. # Create a regex to match the lines of format: # |0x<start> - 0x<end> <binary-image> <version> (<version>) <<UUID>> <path>| # This section is in this format: # |<start address> - <end address> <image name>|. # End when a blank line is hit. # Match the line to the regex. # Store the offsets by image name so it can be referenced during # symbolication. These are hex numbers with leading '0x', so int() can # convert them to decimal if base=0.
self
fd