File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -188,12 +188,27 @@ class SwiftHiddenFrameRecognizer : public StackFrameRecognizer {
188188 RecognizeFrame (lldb::StackFrameSP frame_sp) override {
189189 if (!frame_sp)
190190 return {};
191+
192+ // Hide compiler-generated frames.
193+ if (frame_sp->IsArtificial ())
194+ return m_hidden_frame;
195+
191196 const auto &sc = frame_sp->GetSymbolContext (lldb::eSymbolContextFunction);
192197 if (!sc.function )
193198 return {};
194199
200+ FileSpec source_file;
201+ uint32_t line_no;
202+ sc.function ->GetStartLineSourceInfo (source_file, line_no);
203+ // FIXME: these <compiler-generated> frames should be marked artificial
204+ // by the Swift compiler.
205+ if (source_file.GetFilename () == " <compiler-generated>"
206+ && line_no == 0 )
207+ return m_hidden_frame;
208+
195209 auto symbol_name =
196210 sc.function ->GetMangled ().GetMangledName ().GetStringRef ();
211+
197212 using namespace swift ::Demangle;
198213 using namespace swift_demangle ;
199214 Context demangle_ctx;
Original file line number Diff line number Diff line change @@ -45,15 +45,7 @@ static StackFrameSP FindMostRelevantFrame(Thread &selected_thread) {
4545 // frame. But that could still be in the `std` namespace, so
4646 // check the namespace prefix too.
4747 if (!frame_name.GetStringRef ().starts_with (" std::" ) &&
48- !most_relevant_frame_sp->IsHidden ()
49- #ifdef LLDB_ENABLE_SWIFT
50- // In Swift-C++ interop, we generate frames with a "std."
51- // prefix for functions from libc++. We don't want to
52- // stop in those frames either.
53- && !frame_name.GetStringRef ().starts_with (" __C.std." ) &&
54- !frame_name.GetStringRef ().starts_with (" std." )
55- #endif
56- )
48+ !most_relevant_frame_sp->IsHidden ())
5749 return most_relevant_frame_sp;
5850
5951 ++stack_idx;
You can’t perform that action at this time.
0 commit comments