[Lldb-commits] [lldb] [lldb-dap] Fix typo in StepInTarget serialization (PR #199907)
via lldb-commits
lldb-commits at lists.llvm.org
Wed May 27 02:09:48 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Sergei Druzhkov (DrSergei)
<details>
<summary>Changes</summary>
I fixed small typo and added test for that.
---
Full diff: https://github.com/llvm/llvm-project/pull/199907.diff
2 Files Affected:
- (modified) lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp (+1-1)
- (modified) lldb/unittests/DAP/ProtocolTypesTest.cpp (+12)
``````````diff
diff --git a/lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp b/lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp
index 17e2b4b73f532..b70aeb661f3e1 100644
--- a/lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp
+++ b/lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp
@@ -745,7 +745,7 @@ llvm::json::Value toJSON(const StepInTarget &SIT) {
target.insert({"column", SIT.column});
if (SIT.endLine != LLDB_INVALID_LINE_NUMBER)
target.insert({"endLine", SIT.endLine});
- if (SIT.endLine != LLDB_INVALID_COLUMN_NUMBER)
+ if (SIT.endColumn != LLDB_INVALID_COLUMN_NUMBER)
target.insert({"endColumn", SIT.endColumn});
return target;
diff --git a/lldb/unittests/DAP/ProtocolTypesTest.cpp b/lldb/unittests/DAP/ProtocolTypesTest.cpp
index 56ef6cdbb813f..996b6e3ec6ba5 100644
--- a/lldb/unittests/DAP/ProtocolTypesTest.cpp
+++ b/lldb/unittests/DAP/ProtocolTypesTest.cpp
@@ -10,6 +10,7 @@
#include "Protocol/ProtocolEvents.h"
#include "Protocol/ProtocolRequests.h"
#include "TestingSupport/TestUtilities.h"
+#include "lldb/lldb-defines.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/JSON.h"
#include "llvm/Testing/Support/Error.h"
@@ -759,6 +760,17 @@ TEST(ProtocolTypesTest, StepInTarget) {
EXPECT_EQ(target.column, deserialized_target->column);
EXPECT_EQ(target.endLine, deserialized_target->endLine);
EXPECT_EQ(target.endColumn, deserialized_target->endColumn);
+
+ target.endLine = LLDB_INVALID_LINE_NUMBER;
+ target.endColumn = LLDB_INVALID_COLUMN_NUMBER;
+
+ EXPECT_EQ(R"({
+ "column": 320,
+ "id": 230,
+ "label": "the_function_name",
+ "line": 2
+})",
+ PrettyPrint(target));
}
TEST(ProtocolTypesTest, ReadMemoryArguments) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/199907
More information about the lldb-commits
mailing list