================ @@ -105,6 +105,21 @@ protocol::Source CreateSource(lldb::SBAddress address, lldb::SBTarget &target) { return CreateSource(line_entry.GetFileSpec()); } +protocol::Source CreateSource(lldb::SBFrame frame) { + if (!frame.IsValid()) + return {}; + + const lldb::SBTarget target = frame.GetThread().GetProcess().GetTarget(); + lldb::SBDebugger debugger = target.GetDebugger(); + lldb::StopDisassemblyType stop_disassembly_display = + GetStopDisassemblyDisplay(debugger); + const lldb::SBAddress frame_pc = frame.GetPCAddress(); + if (ShouldDisplayAssemblySource(frame_pc, stop_disassembly_display)) + return CreateAssemblySource(target, frame_pc); + + return CreateSource(frame.GetLineEntry().GetFileSpec()); ---------------- ashgti wrote:
As with the comment on line 109, I think we should update `CreateSource` on line 84 also return an `std::optional<protocol::Source>`, if the file spec is invalid. https://github.com/llvm/llvm-project/pull/143644 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits