[Lldb-commits] [lldb] 99f42e6 - [lldb][dap] always add column field in StackFrame body (#73393)

via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 22 12:51:14 PDT 2024


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 <693788454 at 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);


        


More information about the lldb-commits mailing list