[Lldb-commits] [lldb] r172294 - /lldb/trunk/examples/python/crashlog.py
Sean Callanan
scallanan at apple.com
Fri Jan 11 18:11:49 PST 2013
Author: spyffe
Date: Fri Jan 11 20:11:49 2013
New Revision: 172294
URL: http://llvm.org/viewvc/llvm-project?rev=172294&view=rev
Log:
Made crashlog.py handle cases where a parent
process's name contains spaces. Thanks to
Justin Seyster for the patch.
<rdar://problem/13002540>
Modified:
lldb/trunk/examples/python/crashlog.py
Modified: lldb/trunk/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=172294&r1=172293&r2=172294&view=diff
==============================================================================
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Fri Jan 11 20:11:49 2013
@@ -83,6 +83,7 @@
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 @@
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
More information about the lldb-commits
mailing list