summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlldb/examples/python/crashlog.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 01e284d7d6c..e3fac78dc5e 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -83,6 +83,7 @@ PARSE_MODE_SYSTEM = 4
class CrashLog(symbolication.Symbolicator):
"""Class that does parses darwin crash logs"""
+ parent_process_regex = re.compile('^Parent Process:\s*(.*)\[(\d+)\]');
thread_state_regex = re.compile('^Thread ([0-9]+) crashed with')
thread_regex = re.compile('^Thread ([0-9]+)([^:]*):(.*)')
frame_regex = re.compile('^([0-9]+) +([^ ]+) *\t?(0x[0-9a-fA-F]+) +(.*)')
@@ -265,9 +266,10 @@ class CrashLog(symbolication.Symbolicator):
else:
self.process = version_string
self.process_compatability_version = version_string
- elif line.startswith ('Parent Process:'):
- (self.parent_process_name, pid_with_brackets) = line[15:].strip().split()
- self.parent_process_id = pid_with_brackets.strip('[]')
+ elif self.parent_process_regex.search(line):
+ parent_process_match = self.parent_process_regex.search(line)
+ self.parent_process_name = parent_process_match.group(1)
+ self.parent_process_id = parent_process_match.group(2)
elif line.startswith ('Exception Type:'):
self.thread_exception = line[15:].strip()
continue
OpenPOWER on IntegriCloud