Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb][test] TestDataFormatterLibcxxStringSimulator.py: fix padding f…
…or current layout (llvm#108362) IIUC, the history of `std::string`'s `__short` structure in the alternate ABI layout (as recorded by the simulator test) looks as follows: * First layout ( `SUBCLASS_PADDING` is defined): ``` struct __short { value_type __data_[__min_cap]; struct : __padding<value_type> { unsigned char __size_; }; }; ``` * Then: ``` struct __short { value_type __data_[__min_cap]; unsigned char __padding[sizeof(value_type) - 1]; unsigned char __size_; }; ``` * Then, post-`BITMASKS`: ``` struct __short { value_type __data_[__min_cap]; unsigned char __padding[sizeof(value_type) - 1]; unsigned char __size_ : 7; unsigned char __is_long_ : 1; }; ``` Which is the one that's [on top-of-tree](https://github.com/llvm/llvm-project/blob/89c10e27d8b4d5f44998aad9abd2590d9f96c5df/libcxx/include/string#L854-L859). But for `REVISION > 1`, `BITMASKS` is never set, so for those tests we lose the `__padding` member. This patch fixes this by splitting out the `SUBCLASS_PADDING` out of the ifdef. Drive-by: * Also run expression evaluator on the string to provide is with some extra coverage.
- Loading branch information