[Lldb-commits] [PATCH] D55608: Make crashlog.py work or binaries with spaces in their names

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Dec 16 14:11:16 PST 2018


clayborg requested changes to this revision.
clayborg added inline comments.
This revision now requires changes to proceed.


================
Comment at: examples/python/crashlog.py:99
     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(
----------------
A better regex that removes the need for "image_regex_no_uuid" is:

```
(0x[0-9a-fA-F]+)[-\s]+(0x[0-9a-fA-F]+)\s+[+]?([^\s]+)\s+(\(.+\))?\s?(<([-0-9a-fA-F]+)>)? (.*)
```

The identifier can't contain spaces AFAIK. The problem with the above regex is the "(.+)" is greedy and for

       0x104591000 -        0x1055cfff7 +llvm-dwarfdump (0) <B104CFA1-046A-36A6-8EB4-07DDD7CC2DF3> /Users/USER/Documents/*/llvm-dwarfdump

it consumes "llvm-dwarfdump (0)" and the "(\(.+\))?" gets nothing. Changing "(.+)" to "([^\s]+)" fixes things. Added an extra parens around the UUID <> characters so we won't need image_regex_no_uuid anymore


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55608/new/

https://reviews.llvm.org/D55608





More information about the lldb-commits mailing list