[crashlog] Turn crash log parsing modes into a Python 'enum' (NFC)
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 3 Nov 2020 03:18:51 +0000 (19:18 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 3 Nov 2020 03:42:34 +0000 (19:42 -0800)
commit6c9f3fe908a70a646e619a1355df451c06f6c3a1
tree5e58631607358469be657797bbffe12155cf465d
parentd14e51806b0214560ec99b5d3ce797f5fa3f7522
[crashlog] Turn crash log parsing modes into a Python 'enum' (NFC)

Python doesn't support enums before PEP 435, but using a class with
constants is how it's commonly emulated. It can be converted into a real
Enum (in Python 3.4 and later) by extending the Enum class:

  class CrashLogParseMode(Enum):
      NORMAL = 0
      THREAD = 1
      IMAGES = 2
      THREGS = 3
      SYSTEM = 4
      INSTRS = 5
lldb/examples/python/crashlog.py