tools/mac/symbolicate_crash.py
def _ParseSpindumpStackFrame(self, line):
    """Parses a spindump-style stackframe."""
    frame = StackFrame(line)

    # The format of the frame is either:
    # A: |<space><steps> <symbol> + <offset> (in <image-name>) [<address>]|
    # B: |<space><steps> ??? (in <image-name> + <offset>) [<address>]|
    regex_a = '^([ ]+[0-9]+) (.*) \+ ([0-9]+) \(in (.*)\) \[(0x[0-9a-f]+)\]'
    regex_b = '^([ ]+[0-9]+) \?\?\?( \(in (.*) \+ ([0-9]+)\))? \[(0x[0-9a-f]+)\]'

    # Create the stack frame with the information extracted from the regex.
    matches = re.match(regex_a, line)
    if matches:
      frame.frame_id = matches.group(1)[4:]  # Remove some leading spaces.
      frame.original_symbol = matches.group(2)
      frame.offset = matches.group(3)
      frame.image = matches.group(4)
      frame.address = int(matches.group(5), 0)
      frame.line = None
      return frame

    # If pattern A didn't match (which it will most of the time), try B.
    matches = re.match(regex_b, line)
    if matches:
      frame.frame_id = matches.group(1)[4:]  # Remove some leading spaces.
      frame.image = matches.group(3)
      frame.offset = matches.group(4)
      frame.address = int(matches.group(5), 0)
      frame.line = None
      return frame

    # Otherwise, this frame could not be matched and just use the raw input.
    frame.line = frame.line.strip()
    return frame
Parses a spindump-style stackframe.
Parses a spindump-style stackframe.
Parses a spindump - style stackframe .
def _ParseSpindumpStackFrame(self, line):
    frame = StackFrame(line)
    regex_a = '^([ ]+[0-9]+) (.*) \+ ([0-9]+) \(in (.*)\) \[(0x[0-9a-f]+)\]'
    regex_b = '^([ ]+[0-9]+) \?\?\?( \(in (.*) \+ ([0-9]+)\))? \[(0x[0-9a-f]+)\]'
    matches = re.match(regex_a, line)
    if matches:
      frame.frame_id = matches.group(1)[4:]  
      frame.original_symbol = matches.group(2)
      frame.offset = matches.group(3)
      frame.image = matches.group(4)
      frame.address = int(matches.group(5), 0)
      frame.line = None
      return frame
    matches = re.match(regex_b, line)
    if matches:
      frame.frame_id = matches.group(1)[4:]  
      frame.image = matches.group(3)
      frame.offset = matches.group(4)
      frame.address = int(matches.group(5), 0)
      frame.line = None
      return frame
    frame.line = frame.line.strip()
    return frame
def _ParseSpindumpStackFrame ( self , line ) : frame = StackFrame ( line ) regex_a = '^([ ]+[0-9]+) (.*) \+ ([0-9]+) \(in (.*)\) \[(0x[0-9a-f]+)\]' regex_b = '^([ ]+[0-9]+) \?\?\?( \(in (.*) \+ ([0-9]+)\))? \[(0x[0-9a-f]+)\]' matches = re . match ( regex_a , line ) if matches : frame . frame_id = matches . group ( 1 ) [ 4 : ] frame . original_symbol = matches . group ( 2 ) frame . offset = matches . group ( 3 ) frame . image = matches . group ( 4 ) frame . address = int ( matches . group ( 5 ) , 0 ) frame . line = None return frame matches = re . match ( regex_b , line ) if matches : frame . frame_id = matches . group ( 1 ) [ 4 : ] frame . image = matches . group ( 3 ) frame . offset = matches . group ( 4 ) frame . address = int ( matches . group ( 5 ) , 0 ) frame . line = None return frame frame . line = frame . line . strip ( ) return frame
Parses a spindump-style stackframe.
Parses a spindump - style stackframe .
"""Parses a spindump-style stackframe.""" # The format of the frame is either: # A: |<space><steps> <symbol> + <offset> (in <image-name>) [<address>]| # B: |<space><steps> ??? (in <image-name> + <offset>) [<address>]| # Create the stack frame with the information extracted from the regex. # Remove some leading spaces. # If pattern A didn't match (which it will most of the time), try B. # Remove some leading spaces. # Otherwise, this frame could not be matched and just use the raw input.
self
line