================
@@ -90,9 +79,28 @@ class LibCXXFrameRecognizer : public StackFrameRecognizer {
if (!sc.function)
return {};
- for (RegularExpression &r : m_hidden_regex)
- if (r.Execute(sc.function->GetNameNoArguments()))
+ // Check if we have a regex match
+ for (RegularExpression &r : m_hidden_regex) {
+ if (!r.Execute(sc.function->GetNameNoArguments()))
+ continue;
+
+ // Only hide this frame if the immediate caller is also within libc++.
+ lldb::ThreadSP thread_sp = frame_sp->GetThread();
+ if (!thread_sp)
+ return {};
+ lldb::StackFrameSP parent_frame_sp =
+ thread_sp->GetStackFrameAtIndex(frame_sp->GetFrameIndex() + 1);
+ if (!parent_frame_sp)
+ return {};
+ const auto &parent_sc =
+ parent_frame_sp->GetSymbolContext(lldb::eSymbolContextFunction);
+ if (!parent_sc.function)
+ return {};
+ if (parent_sc.function->GetNameNoArguments().GetStringRef().starts_with(
+ "std::")) {
return m_hidden_frame;
+ }
----------------
vogelsgesang wrote:
Argh. There really should be a clang-tidy check or something similar for this...
https://github.com/llvm/llvm-project/pull/108870
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits