microsoft / microsoft/vscode-java-debug

Cannot debug JDK17 itself with "Debugger for Java" v0.49.1

未关闭
#1,330 10 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ai-triaged bug question
主要语言
TypeScript
星标
591
派生
429
平均合并
1 天 9 小时
30 天内合并 PR
19

描述

I'm building and debugging OpenJDK 17 on Windows 11. I'd like to debug it with VSCode.
I submitted the issue #1285 before for other version of extensions, but now Java Debugger extension seems totally broken.

  1. I have disabled "build before launch" for both User and Workspace, but every time I run the debug configuration (see below), I see the message about "Debug 'Launch Java Program': compiling..." and then "Build failed, do you want to continue?" with a lot of compilation errors.
  2. It can debug source of my tests, but it cannot step in JDK classes. It seems like it cannot find neither source files, not debug info for fresh built fast-debug JDK.
  3. If I open one of JDK java-files in VSCode and try run the debugger (the same configuration), it shows "Debug 'Launch Java Program': compiling...", and may hang until OutOfMemory error occurs.
  4. I have set "java.configuration.runtimes" option to manually downloaded JDK, but, in TaskMonitor, I still see Java.exe process running from "C:\Users\username\.vscode\extensions\redhat.java-1.17.0-win32-x64\jre\17.0.6-win32-x86_64\bin". It looks like scanning my JDK source files, but cannot do this properly. It consumes a lot of memory (1GB+), and reports about OutOfMemory error in VSCode time to time.

Is it really broken now?
Is my configuration wrong maybe?

Environment
  • Operating System: Windows 11
  • JDK version: 17
  • Visual Studio Code version: 1.77.3
  • Extension Pack for Java: v0.25.10
  • Debugger for Java: v0.49.1
  • Language Support for Java(TM) by Red Hat: v1.17.0

My setting.json:

    "java.configuration.runtimes": [
        {
            "default": true,
            "name": "JavaSE-17",
            "path": "c:\\Users\\username\\work\\jdk"
        }
    ]
    "java.debug.settings.onBuildFailureProceed": false,
    "java.debug.settings.forceBuildBeforeLaunch": false

My launch.json:

        {
            "type": "java",
            "name": "Launch Java Program",
            "request": "launch",
            "cwd": "${workspaceFolder}\\jdk\\myjdk\\MyJdkTest\\MyJdkTest",
            "mainClass": "jdk.test.lib.myjdk.MyJdkTest",
            "vmArgs": "-ea <other vm args>",
            "args": "<java test args>",
            "classPaths": [
                "${workspaceFolder}\\classes\\jdk\\myjdk\\MyJdkTest\\MyJdkTest.d",
                "${workspaceFolder}\\classes\\test\\lib"
            ],
            "javaExec": "c:/Users/username/work/myjdk/build/windows-x86_64-server-fastdebug/jdk/bin/java.exe",
        },

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用提供的 settings.json 和 launch.json,在 Windows 11 上使用列出的 OpenJDK 17、VS Code 和扩展版本复现该行为。检查已配置的运行时、build-before-launch 行为、JDK 源代码单步执行以及 Java 进程的内存使用情况;当故障已被隔离,并确定了可正常工作的调试配置或扩展的具体缺陷时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。