Repository navigation
Cannot read field "path" because "lspFrame.source" is null #612
Description
Activity
I got the same issue when using open vsx version of vscode-java-debug 0.58.3.
when i inspect extension dependency jar
~/.vscode/extensions/vscjava.vscode-java-debug-0.58.3/server/com.microsoft.java.debug.plugin-0.53.2.jar, I think the problem is that vscode-java-debug 0.58.3 using an pre release version ofjava-debug.java-debug 0.53.2 is keep changing. if you download the today's latest com.microsoft.java.debug.plugin-0.53.2.jar, and put back to extension folder, the
lspFrame.sourceshould be fixedI test multiple combination of vscode-java-debug 0.58.3 with java-debug 0.53.2
- java-debug 0.53.2 905c7ba (current main), the issue
"lspFrame.source" is nulloccurs. - java-debug 0.53.2 4c80493 . the issue
"lspFrame.source" is nulloccurs. - java-debug 0.53.2 ab5d534 . it works fine. the breakpoints show correctly.
- java-debug 0.53.1 5c7562a . it works fine. the breakpoints show correctly.
It looks like the vscode-java-debug 0.58.3 in https://marketplace.visualstudio.com cached with old jar but is workable java-debug 0.53.2. If we checkout vscode-java-debug 0.58.3 and java-debug latest main, build it from source, just like open vsx marketplace, the issue
"lspFrame.source" is nulloccurs .I got the same issue when using open vsx version of vscode-java-debug 0.58.3.
when i inspect extension dependency jar
~/.vscode/extensions/vscjava.vscode-java-debug-0.58.3/server/com.microsoft.java.debug.plugin-0.53.2.jar, I think the problem is that vscode-java-debug 0.58.3 using an pre release version ofjava-debug.java-debug 0.53.2 is keep changing. if you download the today's latest com.microsoft.java.debug.plugin-0.53.2.jar, and put back to extension folder, the
lspFrame.sourceshould be fixed- java-debug 0.53.2 905c7ba (current main), the issue
I think it's caused by the modification at line 226 in commit 4c80493. In some cases where clientSource is null, the modification
clientLineNumber = 0;causes clientLineNumber and lspFrame.line to definitely be different.line208 convertDebuggerStackFrameToClient() method:
Types.Source clientSource = convertDebuggerSourceToClient(jdiFrame.typeName, jdiFrame.sourceName, jdiFrame.sourcePath, context); String methodName = formatMethodName(jdiFrame.methodName, jdiFrame.argumentTypeNames, jdiFrame.typeName, true, true); int clientLineNumber = AdapterUtils.convertLineNumber(jdiFrame.lineNumber, context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1()); <-- 1️⃣ clientLineNumber // Line number returns -1 if the information is not available; specifically, always returns -1 for native methods. String presentationHint = null; if (clientLineNumber < 0) { presentationHint = "subtle"; if (jdiFrame.isNative) { // For native method, display a tip text "native method" in the Call Stack View. methodName += "[native method]"; } else { // For other unavailable method, such as lambda expression's built-in methods run/accept/apply, // display "Unknown Source" in the Call Stack View. clientSource = new Types.Source("Unknown Source", "unknown", 0); } // DAP specifies lineNumber to be set to 0 when unavailable clientLineNumber = 0; <-- 2️⃣ clientLineNumber changed,and assigned to lspFrame.line
line116 handle() method:
int jdiLineNumber = AdapterUtils.convertLineNumber(jdiFrame.lineNumber, context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1()); <-- Same as 1️⃣ clientLineNumber if (jdiLineNumber != lspFrame.line) { <-- lspFrame.line same as 2️⃣ clientLineNumber decompiledClasses.add(lspFrame.source.path); }
shiben (@BenLocal) can you share some sample code to repro the issue?
- Reacted by Changyong Gong
The latest version 0.58.3 has this problem where breakpoints don't hit properly. Rolling back to version 0.58.2 works normally.
Environment:
Exception: