diff options
author | Jorge Gorbe Moya <jgorbe@google.com> | 2023-04-18 13:19:45 -0700 |
---|---|---|
committer | Jorge Gorbe Moya <jgorbe@google.com> | 2023-05-01 13:08:04 -0700 |
commit | d366da97bd24ddfb91c9f260fa0aaf105d947652 (patch) | |
tree | af5b3d67229adc95288553808a9c1bc72ebd83af /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | fa42e7b6bc430941f42cf50b5c4e55b3c19ccc08 (diff) | |
download | llvm-d366da97bd24ddfb91c9f260fa0aaf105d947652.zip llvm-d366da97bd24ddfb91c9f260fa0aaf105d947652.tar.gz llvm-d366da97bd24ddfb91c9f260fa0aaf105d947652.tar.bz2 |
[lldb] Make the libcxx unique_ptr prettyprinter support custom deleters.
The unique_ptr prettyprinter calls `GetValueOfLibCXXCompressedPair`,
which looks for a `__value_` child. However, when the second value in
the compressed pair is not an empty class, there are two `__value_`
children because `__compressed_pair` derives twice from
`__compressed_pair_elem`, one for each member of the pair. And then the
lookup fails because it's ambiguous.
This patch makes the following changes:
- Rename `GetValueOfLibCXXCompressedPair` to
`GetFirstValueOfLibCXXCompressedPair`, and add a similar function to
get the second value. Put both functions in
Plugin/Language/CPlusPlus/LibCxx.cpp because it seems inappropriate to
have libcxx-specific helpers separate from all the libcxx-dependent
code.
- Read the second value of the `__ptr_` pair and display a "deleter"
child in the unique_ptr synthetic child provider, when available.
- Add a test case for the non-empty deleter case.
Differential Revision: https://reviews.llvm.org/D148662
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
0 files changed, 0 insertions, 0 deletions