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 {
188
188
RecognizeFrame (lldb::StackFrameSP frame_sp) override {
189
189
if (!frame_sp)
190
190
return {};
191
+
192
+ // Hide compiler-generated frames.
193
+ if (frame_sp->IsArtificial ())
194
+ return m_hidden_frame;
195
+
191
196
const auto &sc = frame_sp->GetSymbolContext (lldb::eSymbolContextFunction);
192
197
if (!sc.function )
193
198
return {};
194
199
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
+
195
209
auto symbol_name =
196
210
sc.function ->GetMangled ().GetMangledName ().GetStringRef ();
211
+
197
212
using namespace swift ::Demangle;
198
213
using namespace swift_demangle ;
199
214
Context demangle_ctx;
Original file line number Diff line number Diff line change @@ -45,15 +45,7 @@ static StackFrameSP FindMostRelevantFrame(Thread &selected_thread) {
45
45
// frame. But that could still be in the `std` namespace, so
46
46
// check the namespace prefix too.
47
47
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 ())
57
49
return most_relevant_frame_sp;
58
50
59
51
++stack_idx;
You can’t perform that action at this time.
0 commit comments