tools/mac/symbolicate_crash.py
def _ParseStack(self, fd):
    """Parses the stack dump of a crash report and creates a list of threads
    and their stack traces."""
    # Compile a regex that matches the start of a thread stack. Note that this
    # must be specific to not include the thread state section, which comes
    # right after all the stack traces.
    line_re = re.compile('^Thread ([0-9]+)( Crashed)?:(.*)')

    # On entry into this function, the fd has been walked up to the "Thread 0"
    # line.
    line = fd.readline().rstrip()
    in_stack = False
    thread = None
    while line_re.match(line) or in_stack:
      # Check for start of the thread stack.
      matches = line_re.match(line)

      if not line.strip():
        # A blank line indicates a break in the thread stack.
        in_stack = False
      elif matches:
        # If this is the start of a thread stack, create the CrashThread.
        in_stack = True
        thread = CrashThread(matches.group(1))
        thread.name = matches.group(3)
        thread.did_crash = matches.group(2) != None
        self.threads.append(thread)
      else:
        # All other lines are stack frames.
        thread.stack.append(self._ParseStackFrame(line))
      # Read the next line.
      line = fd.readline()
Parses the stack dump of a crash report and creates a list of threads
    and their stack traces.
Parses the stack dump of a crash report and creates a list of threads
and their stack traces.
Parses the stack dump of a crash report and creates a list of threads and their stack traces .
def _ParseStack(self, fd):
    line_re = re.compile('^Thread ([0-9]+)( Crashed)?:(.*)')
    line = fd.readline().rstrip()
    in_stack = False
    thread = None
    while line_re.match(line) or in_stack:
      matches = line_re.match(line)
      if not line.strip():
        in_stack = False
      elif matches:
        in_stack = True
        thread = CrashThread(matches.group(1))
        thread.name = matches.group(3)
        thread.did_crash = matches.group(2) != None
        self.threads.append(thread)
      else:
        thread.stack.append(self._ParseStackFrame(line))
      line = fd.readline()
def _ParseStack ( self , fd ) : line_re = re . compile ( '^Thread ([0-9]+)( Crashed)?:(.*)' ) line = fd . readline ( ) . rstrip ( ) in_stack = False thread = None while line_re . match ( line ) or in_stack : matches = line_re . match ( line ) if not line . strip ( ) : in_stack = False elif matches : in_stack = True thread = CrashThread ( matches . group ( 1 ) ) thread . name = matches . group ( 3 ) thread . did_crash = matches . group ( 2 ) != None self . threads . append ( thread ) else : thread . stack . append ( self . _ParseStackFrame ( line ) ) line = fd . readline ( )
Parses the stack dump of a crash report and creates a list of threads
and their stack traces.
Parses the stack dump of a crash report and creates a list of threads and their stack traces .
"""Parses the stack dump of a crash report and creates a list of threads
    and their stack traces.""" # Compile a regex that matches the start of a thread stack. Note that this # must be specific to not include the thread state section, which comes # right after all the stack traces. # On entry into this function, the fd has been walked up to the "Thread 0" # line. # Check for start of the thread stack. # A blank line indicates a break in the thread stack. # If this is the start of a thread stack, create the CrashThread. # All other lines are stack frames. # Read the next line.
self
fd