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
Differential D55608
Make crashlog.py work or binaries with spaces in their names aprantl on Dec 12 2018, 11:50 AM. Authored by
Details 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
Diff Detail
Event TimelineComment Actions The frame regex will get confused if you had a binary called "foo 0x1" Then we would treat "foo" as the binary name, 0x1 as the pc, and the rest would be the function name. I don't see how to avoid that altogether. Maybe we could insist that the address have at least 8 numbers in it? Then your binary would have to be called "foo 0x123456789" before we get confused, at which point my caring level has dropped pretty low. I'm not sure about the image regex. In the part where we are grabbing version numbers, you've replaced: ([^<]+) with ([0-9a-zA-Z_]+) In crashlogs, I see lines like: 0x10b60b000 - 0x10f707fff com.apple.LLDB.framework (1.1000.11.38.2 - 1000.11.38.2) <96E36F5C-1A83-39A1-8713-5FDD9701C3F1> /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/LLDB In the first form "([^<]+)" will grab "(1.1000.11.38.2 - 1000.11.38.2) ". I presume we just discard this bit. But ([0-9a-zA-Z_]+) will stop at the first"(" for the version number, won't it?
Comment Actions Fixed the reported problems with the regexes and added testcases with example lines. I used the funny test setup to avoid burdening the installed crashlog.py script with unit test code that would need to be parsed every time.
|