[lldb/Dataformatters] Adapt C++ std::string dataformatter for D128285
This patch changes the C++ std::string dataformatter to reflect
internal layout changes following D128285.
Now, in short-mode strings, in order to access the __size_ and
__is_long_ attributes, we need to access a packed anonymous struct,
which introduces another indirection.
We need to do the same in order to access the __cap_ field for
long-mode strings.
This should fix the various test failures that are happening on
GreenDragon:
https://green.lab.llvm.org/green/job/lldb-cmake/44918/
rdar://96010248
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Let me know if I',m misunderstanding what the code is doing, but this looks like it is replacing the previous implementation? Ideally we would detect the layout and then parse it correctly depending on which version we're dealing with. Otherwise we risk breaking the matrix bot that checks that LLDB can debug C++ produced by older versions of LLVM (and by extension libcxx).