Author: Xu Jun
Date: 2024-04-22T15:51:11-04:00
New Revision: 99f42e6b88177328ebe725b5cb6d422106bbb3e6

URL: 
https://github.com/llvm/llvm-project/commit/99f42e6b88177328ebe725b5cb6d422106bbb3e6
DIFF: 
https://github.com/llvm/llvm-project/commit/99f42e6b88177328ebe725b5cb6d422106bbb3e6.diff

LOG: [lldb][dap] always add column field in StackFrame body (#73393)

The `column` field is mandatory in StackTraceResponse, otherwise the
debugger client may raise error (e.g. VSCode can't correctly open an
editor without the column field)

---------

Signed-off-by: Xu Jun <693788...@qq.com>

Added: 
    

Modified: 
    lldb/tools/lldb-dap/JSONUtils.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index 878449a91aa66a..b4a2718bbb096e 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -748,9 +748,10 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
     auto line = line_entry.GetLine();
     if (line && line != LLDB_INVALID_LINE_NUMBER)
       object.try_emplace("line", line);
+    else
+      object.try_emplace("line", 0);
     auto column = line_entry.GetColumn();
-    if (column && column != LLDB_INVALID_COLUMN_NUMBER)
-      object.try_emplace("column", column);
+    object.try_emplace("column", column);
   } else {
     object.try_emplace("line", 0);
     object.try_emplace("column", 0);


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to