[Lldb-commits] [lldb] r162806 - /lldb/trunk/examples/python/crashlog.py

Jason Molenda jmolenda at apple.com
Tue Aug 28 16:46:12 PDT 2012


Author: jmolenda
Date: Tue Aug 28 18:46:12 2012
New Revision: 162806

URL: http://llvm.org/viewvc/llvm-project?rev=162806&view=rev
Log:
Instead of using re.split and requiring two spaces between the "regname: regvalue" pairs,
use re.findall and specify the regexp of regname: regvalue that we're interested in.
<rdar://problem/12188752> 

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=162806&r1=162805&r2=162806&view=diff
==============================================================================
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Tue Aug 28 18:46:12 2012
@@ -316,7 +316,8 @@
 
             elif parse_mode == PARSE_MODE_THREGS:
                 stripped_line = line.strip()
-                reg_values = re.split('  +', stripped_line);
+                # "r12: 0x00007fff6b5939c8  r13: 0x0000000007000006  r14: 0x0000000000002a03  r15: 0x0000000000000c00"
+                reg_values = re.findall ('([a-zA-Z0-9]+: 0[Xx][0-9a-fA-F]+) *', stripped_line);
                 for reg_value in reg_values:
                     #print 'reg_value = "%s"' % reg_value
                     (reg, value) = reg_value.split(': ')





More information about the lldb-commits mailing list