aprantl created this revision.
aprantl added reviewers: jasonmolenda, jingham.

This is a little dangerous since the crashlog files aren't 100% unambiguous, 
but the risk is mitigated by using a non-greedy `+?` pattern.

rdar://problem/38478511


https://reviews.llvm.org/D55608

Files:
  examples/python/crashlog.py


Index: examples/python/crashlog.py
===================================================================
--- examples/python/crashlog.py
+++ examples/python/crashlog.py
@@ -94,11 +94,11 @@
     thread_regex = re.compile('^Thread ([0-9]+)([^:]*):(.*)')
     app_backtrace_regex = re.compile(
         '^Application Specific Backtrace ([0-9]+)([^:]*):(.*)')
-    frame_regex = re.compile('^([0-9]+)\s+([^ ]+)\s+(0x[0-9a-fA-F]+) +(.*)')
+    frame_regex = re.compile('^([0-9]+)\s+(.+?)\s+(0x[0-9a-fA-F]+) +(.*)')
     image_regex_uuid = re.compile(
-        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) 
+([^<]+)<([-0-9a-fA-F]+)> (.*)')
+        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?(.+?) 
+([^<]+)<([-0-9a-fA-F]+)> (.*)')
     image_regex_no_uuid = re.compile(
-        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) +([^/]+)/(.*)')
+        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?(.+?) +([^/]+)/(.*)')
     empty_line_regex = re.compile('^$')
 
     class Thread:
@@ -300,6 +300,7 @@
                     return False
             if not self.resolved_path and not os.path.exists(self.path):
                 try:
+                    import pdb; pdb.set_trace()
                     import subprocess
                     dsym = subprocess.check_output(
                         ["/usr/bin/mdfind",


Index: examples/python/crashlog.py
===================================================================
--- examples/python/crashlog.py
+++ examples/python/crashlog.py
@@ -94,11 +94,11 @@
     thread_regex = re.compile('^Thread ([0-9]+)([^:]*):(.*)')
     app_backtrace_regex = re.compile(
         '^Application Specific Backtrace ([0-9]+)([^:]*):(.*)')
-    frame_regex = re.compile('^([0-9]+)\s+([^ ]+)\s+(0x[0-9a-fA-F]+) +(.*)')
+    frame_regex = re.compile('^([0-9]+)\s+(.+?)\s+(0x[0-9a-fA-F]+) +(.*)')
     image_regex_uuid = re.compile(
-        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) +([^<]+)<([-0-9a-fA-F]+)> (.*)')
+        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?(.+?) +([^<]+)<([-0-9a-fA-F]+)> (.*)')
     image_regex_no_uuid = re.compile(
-        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) +([^/]+)/(.*)')
+        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?(.+?) +([^/]+)/(.*)')
     empty_line_regex = re.compile('^$')
 
     class Thread:
@@ -300,6 +300,7 @@
                     return False
             if not self.resolved_path and not os.path.exists(self.path):
                 try:
+                    import pdb; pdb.set_trace()
                     import subprocess
                     dsym = subprocess.check_output(
                         ["/usr/bin/mdfind",
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to