[Lldb-commits] [PATCH] D131719: [lldb/crashlog] Adapt raw text crashlog exception to json format

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 11 16:19:00 PDT 2022


kastiglione added inline comments.


================
Comment at: lldb/examples/python/crashlog.py:343
         self.errors = list()
+        self.exception = None
         self.crashed_thread_idx = -1
----------------
should this be initialized to `{}`?


================
Comment at: lldb/examples/python/crashlog.py:684
+            if exception_type_match:
+                exc_type, _, exc_signal = exception_type_match.groups()
+                self.crashlog.exception = { 'type': exc_type }
----------------
if you would like to avoid the ignored group (`_`) then you can use non-capturing grouping `(?:...)` in the regex:

before:
```
r'^Exception Type:\s+(EXC_[A-Z_]+)(\s+\((.*)\))?'
```

after:
```
r'^Exception Type:\s+(EXC_[A-Z_]+)(?:\s+\((.*)\))?'
```


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

https://reviews.llvm.org/D131719



More information about the lldb-commits mailing list