tools/mac/symbolicate_crash.py
def _ParseHeader(self, fd):
    """Parses the header section of a crash report, which contains the OS and
    application version information."""
    # The header is made up of different sections, depending on the type of
    # report and the report version. Almost all have a format of a key and
    # value separated by a colon. Accumulate all of these artifacts into a
    # dictionary until the first thread stack is reached.
    thread_re = re.compile('^[ \t]*Thread ([a-f0-9]+)')
    line = ''
    while not thread_re.match(line):
      # Skip blank lines. There are typically three or four sections separated
      # by newlines in the header.
      line = line.strip()
      if line:
        parts = line.split(':', 1)
        # Certain lines in different report versions don't follow the key-value
        # format, so skip them.
        if len(parts) == 2:
          # There's a varying amount of space padding after the ':' to align all
          # the values; strip that.
          self.report_info[parts[0]] = parts[1].lstrip()
      line = fd.readline()

    # When this loop exits, the header has been read in full. However, the first
    # thread stack heading has been read past. Seek backwards from the current
    # position by the length of the line so that it is re-read when
    # _ParseStack() is entered.
    fd.seek(-len(line), os.SEEK_CUR)
Parses the header section of a crash report, which contains the OS and
    application version information.
Parses the header section of a crash report, which contains the OS and
application version information.
Parses the header section of a crash report which contains the OS and application version information .
def _ParseHeader(self, fd):
    thread_re = re.compile('^[ \t]*Thread ([a-f0-9]+)')
    line = ''
    while not thread_re.match(line):
      line = line.strip()
      if line:
        parts = line.split(':', 1)
        if len(parts) == 2:
          self.report_info[parts[0]] = parts[1].lstrip()
      line = fd.readline()
    fd.seek(-len(line), os.SEEK_CUR)
def _ParseHeader ( self , fd ) : thread_re = re . compile ( '^[ \t]*Thread ([a-f0-9]+)' ) line = '' while not thread_re . match ( line ) : line = line . strip ( ) if line : parts = line . split ( ':' , 1 ) if len ( parts ) == 2 : self . report_info [ parts [ 0 ] ] = parts [ 1 ] . lstrip ( ) line = fd . readline ( ) fd . seek ( - len ( line ) , os . SEEK_CUR )
Parses the header section of a crash report, which contains the OS and
application version information.
Parses the header section of a crash report which contains the OS and application version information .
"""Parses the header section of a crash report, which contains the OS and
    application version information.""" # The header is made up of different sections, depending on the type of # report and the report version. Almost all have a format of a key and # value separated by a colon. Accumulate all of these artifacts into a # dictionary until the first thread stack is reached. # Skip blank lines. There are typically three or four sections separated # by newlines in the header. # Certain lines in different report versions don't follow the key-value # format, so skip them. # There's a varying amount of space padding after the ':' to align all # the values; strip that. # When this loop exits, the header has been read in full. However, the first # thread stack heading has been read past. Seek backwards from the current # position by the length of the line so that it is re-read when # _ParseStack() is entered.
self
fd