aboutsummaryrefslogtreecommitdiff
path: root/lldb/examples/python/crashlog.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-05-10 22:45:54 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-05-10 22:45:54 +0000
commitafc98a6d7e37f0e5db853e97a677c9edcb66a2b2 (patch)
tree91e3496424eac335fb69212ed115d39bfb0822a2 /lldb/examples/python/crashlog.py
parent77cbb8481b52b155f07501b80cfc86ec7a2eb75d (diff)
downloadllvm-afc98a6d7e37f0e5db853e97a677c9edcb66a2b2.zip
llvm-afc98a6d7e37f0e5db853e97a677c9edcb66a2b2.tar.gz
llvm-afc98a6d7e37f0e5db853e97a677c9edcb66a2b2.tar.bz2
Make crashlog.py more robust when dealing with the "Version: ..." header from the crash log file.
rdar://problem/11428134 llvm-svn: 156581
Diffstat (limited to 'lldb/examples/python/crashlog.py')
-rwxr-xr-xlldb/examples/python/crashlog.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 30f0a62..35c1b14 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -213,8 +213,14 @@ class CrashLog(symbolication.Symbolicator):
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('[]')