[Lldb-commits] [lldb] r156581 - /lldb/trunk/examples/python/crashlog.py
Johnny Chen
johnny.chen at apple.com
Thu May 10 15:45:54 PDT 2012
Author: johnny
Date: Thu May 10 17:45:54 2012
New Revision: 156581
URL: http://llvm.org/viewvc/llvm-project?rev=156581&view=rev
Log:
Make crashlog.py more robust when dealing with the "Version: ..." header from the crash log file.
rdar://problem/11428134
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=156581&r1=156580&r2=156581&view=diff
==============================================================================
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Thu May 10 17:45:54 2012
@@ -213,8 +213,14 @@
elif line.startswith ('Identifier:'):
self.process_identifier = line[11:].strip()
elif line.startswith ('Version:'):
- (self.process_version, compatability_version) = line[8:].strip().split()
- self.process_compatability_version = compatability_version.strip('()')
+ version_string = line[8:].strip()
+ matched_pair = re.search("(.+)\((.+)\)", version_string)
+ if matched_pair:
+ self.process_version = matched_pair.group(1)
+ self.process_compatability_version = matched_pair.group(2)
+ 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('[]')
More information about the lldb-commits
mailing list