4 Commits

Author SHA1 Message Date
Michael Buch
d5e610a6dc
[lldb][Formatters] Remove broken/redundant lookup into anonymous child when extracting from compressed pairs (#175564)
(brought to my attention in
https://github.com/llvm/llvm-project/pull/155153#discussion_r2682666325)

This patch removes the `anon_struct_idx` of
`GetValueOrOldCompressedPair`.

The latest `_LIBCPP_COMPRESSED_PAIR` wraps the members in an anonymous
structure. Around the time of the original patch that introduced
`GetValueOrOldCompressedPair`
(https://github.com/llvm/llvm-project/pull/155153),
`GetChildMemberWithName` wasn't capable of "seeing through" anonymous
structures when searching for children. However, around the same time as
https://github.com/llvm/llvm-project/pull/155153 landed, the
`GetChildMemberWithName` behaviour was fixed (in
https://github.com/llvm/llvm-project/pull/138487). So regardless of
whether the the compressed pair is wrapped in an anonymous structure,
simply calling `GetChildMemberWithName` is the right thing to do.

We weren't even using the result of `GetChildAtIndex`, so we were always
calling `GetChildMemberWithName` with the root ValueObject anyways.

Our `libcxx-simulators` already test both compressed pair layouts, so no
extra coverage is needed here.
2026-01-12 16:31:07 +00:00
nerix
cd805a7373
[LLDB] Run MSVC STL (forward-)list test with PDB (#166953)
Since PDB doesn't have template information, we need to get the element
type from somewhere else. I'm using the type of `_Myval` in a list node,
which holds the element type.
2025-12-09 19:09:33 +01:00
Michael Buch
20dd053160
[lldb][DataFormatters] Support newer _LIBCPP_COMPRESSED_PAIR layout (#155153)
Starting with https://github.com/llvm/llvm-project/pull/154686 the
compressed_pair children are now wrapped in an anonymous structure.

This patch adjusts the LLDB data-formatters to support that.

Outstanding questions:
1. Should GetChildMemberWithName look through anonymous structures? That
will break users most likely. But maybe introducing a new API is worth
it? Then we wouldnt have to do this awkward passing around of
`anon_struct_index`
2. Do we support the layout without the anonymous structure? It's not
too much added complexity. And we did release that version of libc++, so
there is code out there compiled against it. But there is no great way
of testing it (some of our macOS matrix bots do test it i suppose, but
not in a targeted way). We have the layout "simulator" tests for some of
the STL types which I will adjust.
2025-08-25 09:17:55 -07:00
nerix
88a498c3b1
[LLDB] Add formatters for MSVC STL std::(forward_)list (#148285)
Adds synthetic providers for MSVC's `std::forward_list` and `std::list`.
It refactors `LibCxxList` to be generic over the STL type (currently
libc++ or MSVC STL). The libstdc++ synthetic providers use something
similar in Python
[here](3092b765ba/lldb/examples/synthetic/gnu_libstdcpp.py (L134)).
Eventually, this could be ported to C++ as well.

Towards #24834.
2025-07-16 14:00:18 +01:00