[Lldb-commits] [PATCH] D131138: [lldb] Dynamically generate enum names in lldbutil
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 5 10:02:47 PDT 2022
JDevlieghere added a comment.
In D131138#3702608 <https://reviews.llvm.org/D131138#3702608>, @jingham wrote:
> 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.
I don't think that's possible, at least not without having both, which then defeats the purpose. I suggested to Ismail that we should start a document to keep track of all the things we want to improve for a V2 of the SB API. These kind of ideas come up every once in a while and it would be good to have them tracked somewhere so they don't get lost with time if/when we ever decide to redo the stable API.
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