-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[lldb][dap] always add column field in StackFrame body #73393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Xu Jun <[email protected]>
@llvm/pr-subscribers-lldb Author: Xu Jun (xujuntwt95329) ChangesThe Full diff: https://github.com/llvm/llvm-project/pull/73393.diff 1 Files Affected:
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp b/lldb/tools/lldb-dap/JSONUtils.cpp
index 03a43f9da87f241..e65b05243df7066 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -817,8 +817,7 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
if (line && line != LLDB_INVALID_LINE_NUMBER)
object.try_emplace("line", line);
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);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Bug confirmed. Its causing exception for nvim-dap plugin which expects column required in specification, but not sent by server.
|
@semensanyok, I've just merged this PR because it's very straightforward. If it breaks the buildbots, I'll just revert it and let the original author fix it. |
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 <[email protected]> (cherry picked from commit 99f42e6)
llvm#73393 introduced a mandatory column field. Update test for that. (cherry picked from commit aa89c1b)
It still has bug in VSCode: The editor could not be opened due to an unexpected error: Invalid arguments My llvm version is
platform is microsoft windows 11 professional |
I wonder if this needs to default to column 1? We might end up adding column zero.
So if we return zero, it might cause a problem as the
1 is the default, and if we return zero, this could cause a problem? |
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)