[all-commits] [llvm/llvm-project] 6fec6a: [lldb][Formatters] Make libc++ and libstdc++ std::...

Michael Buch via All-commits all-commits at lists.llvm.org
Mon Jul 7 01:14:14 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6fec6a98c01523a5478ce2aa9617e884dc772f6f
      https://github.com/llvm/llvm-project/commit/6fec6a98c01523a5478ce2aa9617e884dc772f6f
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2025-07-07 (Mon, 07 Jul 2025)

  Changed paths:
    M lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
    M lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
    M lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py

  Log Message:
  -----------
  [lldb][Formatters] Make libc++ and libstdc++ std::shared_ptr formatters consistent with each other (#147165)

This patch adjusts the libcxx and libstdcxx std::shared_ptr formatters
to look the same.

Changes to libcxx:
* Now creates a synthetic child called `pointer` (like we already do for
`std::unique_ptr`)

Changes to libstdcxx:
* When asked to dereference the pointer, cast the type of the result
ValueObject to the element type (which we get from the template argument
to std::shared_ptr).
Before:
```
(std::__shared_ptr<int, __gnu_cxx::_S_atomic>::element_type) *foo = 123
```
After:
```
(int) *foo = 123
```

Tested in https://github.com/llvm/llvm-project/pull/147141



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list