llvm-project
14ac9dfd - [lldb] Add lldb.summary and lldb.synthetic decorators (#195351)

Commit
2 days ago
[lldb] Add lldb.summary and lldb.synthetic decorators (#195351) Adds two new decorators, `@lldb.summary` and `@lldb.synthetic`, analogous to the existing `@lldb.command` decorator. ```python @lldb.summary("MyType") def MyType_summary(valobj, _): return "summary string" @lldb.synthetic("MyContainer") class MyContainerSynthetic: def __init__(self, valobj, _): ... ``` These decorators result in `type summary add` and `type synthetic add` commands being run. An additional motivation: these decorators will make it straightforward to invoke the Python-to-LLDB formatter bytecode compiler (`formatter_bytecode.Compiler`), which currently requires command-line flags to know how to register formatters. With these decorators, the registration metadata is associated directly with the implementing function or class. See the docstrings and formatters.py test fixture for usage examples. Assisted-by: claude
Author
Parents
Loading