diff --git a/lldb/tools/lldb-vscode/JSONUtils.cpp b/lldb/tools/lldb-vscode/JSONUtils.cpp --- a/lldb/tools/lldb-vscode/JSONUtils.cpp +++ b/lldb/tools/lldb-vscode/JSONUtils.cpp @@ -613,7 +613,9 @@ llvm::json::Value CreateSource(lldb::SBFrame &frame, int64_t &disasm_line) { disasm_line = 0; auto line_entry = frame.GetLineEntry(); - if (line_entry.GetFileSpec().IsValid()) + // A line entry of 0 indicates the line is compiler generated i.e. no source + // file so don't return early with the line entry. + if (line_entry.GetFileSpec().IsValid() && line_entry.GetLine() != 0) return CreateSource(line_entry); llvm::json::Object object; @@ -650,7 +652,11 @@ } const auto num_insts = insts.GetSize(); if (low_pc != LLDB_INVALID_ADDRESS && num_insts > 0) { - EmplaceSafeString(object, "name", frame.GetFunctionName()); + if (line_entry.GetLine() == 0) { + EmplaceSafeString(object, "name", ""); + } else { + EmplaceSafeString(object, "name", frame.GetDisplayFunctionName()); + } SourceReference source; llvm::raw_string_ostream src_strm(source.content); std::string line;