microsoft / microsoft/vscode-java-debug

Breakpoints don’t bind when attaching to JVM in WSL2 from Windows (Cursor/VS Code) — requests hang, `jdb` hits fine

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

还没有人认领这个 Issue。

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

描述

Environment

  • Host OS: Windows 11
  • IDE: Cursor/VS Code on Windows with repo mounted via WSL2
  • Guest OS: WSL2 Ubuntu 22.04
  • Java: OpenJDK 1.8.0_432 (Java 8)
  • Extensions:
    • Debugger for Java: latest version
    • Language Support for Java™ by Red Hat: 1.47.0
  • Project: Spring Boot API (Gradle)

Expected behavior
Attach to 127.0.0.1:5005 and stop at breakpoints in controllers; HTTP requests hang until continued.

Actual behavior
Attach connects but IDE never stops at breakpoints; HTTP requests hang. Attaching with jdb hits breakpoints fine, so JDWP works. Rolling back both extensions fixes it.

Steps to reproduce

  1. Build: ./gradlew clean assemble -x test
  2. Run jar with JDWP:
    java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 \
         -Dspring.profiles.active=local -Duser.timezone=UTC \
         -jar build/libs/*.jar
    
  3. In Windows Cursor/VS Code, attach to host 127.0.0.1 port 5005.
  4. Set breakpoint in a @RestController method.
  5. Call the endpoint.

More info

  • javap -v shows SourceFile and LineNumberTable.
  • Verified JDWP by attaching via jdb -attach 127.0.0.1:5005; breakpoints hit.
  • Rolling back Debugger for Java (e.g., to 0.58.2) and Language Support for Java (e.g., to 1.46.0) resolves the problem.

Workaround
Roll back both Java extensions or use jdb.

Notes
Seems specific to Windows host + WSL2 remote debug mapping; not reproducible with native Windows debug.

贡献指南

打开贡献指南

从这里开始

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

调研方向

使用提供的 Gradle 和 JDWP 命令,结合 Windows 11、WSL2 Ubuntu、Java 8 以及列出的扩展版本,重现 attach 场景。将 IDE 的行为与 jdb -attach 127.0.0.1:5005 以及所述的扩展回滚版本进行比较;完成的标准是控制器断点能够绑定,并且 HTTP 请求能够正确恢复。

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

评估

技术栈
java, typescript, vscode
领域
devtools
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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