[libcxx-commits] [libcxx] [lldb] [lldb][libc++] Hide all libc++ implementation details from stacktraces (PR #108870)
Michael Buch via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Sep 23 06:49:31 PDT 2024
================
@@ -90,9 +79,26 @@ class LibCXXFrameRecognizer : public StackFrameRecognizer {
if (!sc.function)
return {};
+ // Check if we have a regex match
+ bool matches_regex = false;
for (RegularExpression &r : m_hidden_regex)
- if (r.Execute(sc.function->GetNameNoArguments()))
+ if (r.Execute(sc.function->GetNameNoArguments())) {
+ matches_regex = true;
+ break;
+ }
+
+ if (matches_regex) {
+ // Only hide this frame if the immediate caller is also within libc++.
+ lldb::StackFrameSP parent_frame =
+ frame_sp->GetThread()->GetStackFrameAtIndex(
+ frame_sp->GetFrameIndex() + 1);
+ const auto &parent_sc =
+ parent_frame->GetSymbolContext(lldb::eSymbolContextFunction);
+ if (parent_sc.function->GetNameNoArguments().GetStringRef().starts_with(
----------------
Michael137 wrote:
`parent_sc.function` may not exist.
https://github.com/llvm/llvm-project/pull/108870
More information about the libcxx-commits
mailing list