[Lldb-commits] [PATCH] D131138: [lldb] Dynamically generate enum names in lldbutil

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 5 09:59:45 PDT 2022


jingham added a comment.

In D131138#3698508 <https://reviews.llvm.org/D131138#3698508>, @mib wrote:

> This is awesome 🤩 ! I was also thinking of changing the way enums are exposed to python: instead of having everything added to the `lldb` python module, we could create a class per enum and have static attributes for each enum value so we could do something like `lldb.StopReason.Breakpoint`. That static variable could be a pair with the value/string representation or maybe we could use the `__str__` method to make it very pythonic. Just throwing some ideas here for later, but this LGTM 😊 !

I'm not sure you could do this w/o breaking binary compatibility, since we pass these enums to a bunch of the SB API's.  But if you can make that work, this would be nice.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131138



More information about the lldb-commits mailing list