================ @@ -785,11 +785,18 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) { int64_t frame_id = MakeDAPFrameID(frame); object.try_emplace("id", frame_id); - // `function_name` can be a nullptr, which throws an error when assigned to an - // `std::string`. - const char *function_name = frame.GetDisplayFunctionName(); - std::string frame_name = - function_name == nullptr ? std::string() : function_name; + std::string frame_name; + if (g_dap.frame_format.IsValid()) { + lldb::SBStream stream; + frame.GetDescriptionWithFormat(g_dap.frame_format, stream, "No value"); ---------------- clayborg wrote:
Doesn't make sense to show "No value" here, that will confuse users. we should listen to this return value and allow the standard code below to run `frame.GetDisplayFunctionName()`. ``` std::string frame_name; lldb::SBStream stream; if (g_dap.frame_format.IsValid() && frame.GetDescriptionWithFormat(g_dap.frame_format, stream)) frame_name = stream.GetData(); else if (const char *name = frame.GetDisplayFunctionName()) frame_name = name; https://github.com/llvm/llvm-project/pull/71843 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits