[all-commits] [llvm/llvm-project] 7e1657: [lldb][libc++] Hide all libc++ implementation deta...

Adrian Vogelsgesang via All-commits all-commits at lists.llvm.org
Thu Oct 10 10:27:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e16571eb02e7e9da24fee45359e981af783d0d0
      https://github.com/llvm/llvm-project/commit/7e16571eb02e7e9da24fee45359e981af783d0d0
  Author: Adrian Vogelsgesang <avogelsgesang at salesforce.com>
  Date:   2024-10-10 (Thu, 10 Oct 2024)

  Changed paths:
    M libcxx/docs/UserDocumentation.rst
    M lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
    A lldb/test/API/lang/cpp/libcxx-internals-recognizer/Makefile
    A lldb/test/API/lang/cpp/libcxx-internals-recognizer/TestLibcxxInternalsRecognizer.py
    A lldb/test/API/lang/cpp/libcxx-internals-recognizer/main.cpp
    R lldb/test/API/lang/cpp/std-invoke-recognizer/Makefile
    R lldb/test/API/lang/cpp/std-invoke-recognizer/TestStdInvokeRecognizer.py
    R lldb/test/API/lang/cpp/std-invoke-recognizer/main.cpp

  Log Message:
  -----------
  [lldb][libc++] Hide all libc++ implementation details from stacktraces (#108870)

This commit changes the libc++ frame recognizer to hide implementation
details of libc++ more aggressively. The applied heuristic is rather
straightforward: We consider every function name starting with `__` as
an implementation detail.

This works pretty neatly for `std::invoke`, `std::function`,
`std::sort`, `std::map::emplace` and many others. Also, this should
align quite nicely with libc++'s general coding convention of using the
`__` for their implementation details, thereby keeping the future
maintenance effort low.

However, this heuristic by itself does not work in 100% of the cases:
E.g., `std::ranges::sort` is not a function, but an object with an
overloaded `operator()`, which means that there is no actual call
`std::ranges::sort` in the call stack. Instead, there is a
`std::ranges::__sort::operator()` call. To make sure that we don't hide
this stack frame, we never hide the frame which represents the entry
point from user code into libc++ code



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