mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
This introduces a debugging data formatter for RigidArray using a new feature of LLDB: [Formatter Bytecode][1]. The scope of this PR is a single initial data type, with the short and long term plan being to support all types vended by Swift Collections. The bytecode for this implementation is produced using a Python -> Formatter Bytecode compiler, contained in the [`formatter_bytecode`][2] module. The workflow for authoring and shipping the formatter is: 1. Update RigidArray.py as needed 2. Compile RigidArray.py to RigidArray+Formatter.swift (again, `formatter_bytecode`) 3. Compile RigidArray+Formatter.swift as part of the BasicContainers module By including the bytecode in the binary, lldb can load RigidArray's data formatter automatically, without any friction that comes with installation, setup, config, updating, or versioning. [1]: https://lldb.llvm.org/resources/formatterbytecode.html [2]: https://github.com/llvm/llvm-project/blob/main/lldb/examples/python/formatter_bytecode.py