ivanhernandez13 created this revision. Herald added a project: All. ivanhernandez13 requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
According to https://github.com/llvm/llvm-project/blob/fbcefff9d0a3f5e97270ef8e7b8e0f2afc33dc1c/lldb/source/Symbol/LineEntry.cpp#L215, a line entry of 0 indicates compiler generated code. Despite it being generated code, the SBLineEntry.GetFileSpec().IsValid() check can be true in which case lldb-vscode responds with a non-existent file named "<compiler-generated>". This patch will instead have lldb-vscode return the disassembly of the generated code. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D141637 Files: lldb/tools/lldb-vscode/JSONUtils.cpp Index: lldb/tools/lldb-vscode/JSONUtils.cpp =================================================================== --- lldb/tools/lldb-vscode/JSONUtils.cpp +++ lldb/tools/lldb-vscode/JSONUtils.cpp @@ -613,7 +613,7 @@ llvm::json::Value CreateSource(lldb::SBFrame &frame, int64_t &disasm_line) { disasm_line = 0; auto line_entry = frame.GetLineEntry(); - if (line_entry.GetFileSpec().IsValid()) + if (line_entry.GetFileSpec().IsValid() && line_entry.GetLine() != 0) return CreateSource(line_entry); llvm::json::Object object;
Index: lldb/tools/lldb-vscode/JSONUtils.cpp =================================================================== --- lldb/tools/lldb-vscode/JSONUtils.cpp +++ lldb/tools/lldb-vscode/JSONUtils.cpp @@ -613,7 +613,7 @@ llvm::json::Value CreateSource(lldb::SBFrame &frame, int64_t &disasm_line) { disasm_line = 0; auto line_entry = frame.GetLineEntry(); - if (line_entry.GetFileSpec().IsValid()) + if (line_entry.GetFileSpec().IsValid() && line_entry.GetLine() != 0) return CreateSource(line_entry); llvm::json::Object object;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits