Skip to content

[WIP] feat(debug): build shared Java debug foundation - #323

Draft
1lck wants to merge 47 commits into
previewfrom
codex/java-debug
Draft

[WIP] feat(debug): build shared Java debug foundation#323
1lck wants to merge 47 commits into
previewfrom
codex/java-debug

Conversation

@1lck

@1lck1lck commented Aug 29, 2026

Copy link
Copy Markdown
Owner

状态

🚧 Draft/WIP,仍在开发,暂不合并。

关联 #317。当前以 macOS 为参考实现;Windows 产品代码保持不变,待 macOS 验证稳定后再接入共享 Rust 接口。

当前能力

  • 通用 DAP 会话、状态机、能力协商、请求关联、取消与超时已下沉到 Rust Core
  • macOS Java Debug 已接入 JDT LS Java Debug Server,复用 Run 配置中的 JDK、Maven、环境变量和启动参数
  • 支持源码、条件、命中次数、日志、异常、方法和字段断点,以及启用、静音、持久化、源码编辑后迁移和绑定状态
  • 支持暂停定位、线程、调用栈、变量树、分页加载、Watch、表达式求值、变量修改、悬停和行内变量
  • 支持继续、暂停、步入、步过、步出、智能步入、回退、运行到光标和 Java 单步过滤
  • Debug Console 镜像目标程序输出,过滤 ANSI 控制序列并保留 400,000 字符上限
  • 支持多个独立 Debug 会话并存、会话切换、独立 Console/状态/异常/启动配置,以及单独停止会话
  • 新会话启动失败时会恢复原活动会话,不覆盖原会话的界面状态
  • Debug 工具窗口增加会话选择菜单;Windows 未修改

本次同步

提交:8cb16a55

  • DebugAdapterSessionManager 增加稳定的 DebugSessionID 和会话摘要,按会话隔离状态与事件
  • 同一语言 Provider 的源码、异常、方法和字段断点更新会同步到全部活动会话
  • GenericDebugFeatureModel 按会话保存和恢复 Console、暂停上下文、能力、错误与启动请求
  • Debug 模块活跃状态和 Lease 改为检查全部会话
  • 新增多会话隔离、切换和启动失败恢复回归测试

已验证

  • ./scripts/test-macos.sh --no-parallel:731 个测试、83 个 suite 全部通过
  • verify-test-stability.sh:通过
  • macOS 定向稳定性计时:新增会话启动失败恢复测试通过,耗时约 1 ms
  • verify-service-boundaries.sh:通过
  • git diff --check:通过

尚在进行

  • 真实 JDT LS/JVM 集成项目验收,以及更复杂的 Maven、Gradle、多模块和框架项目矩阵
  • Debug 工具窗口布局、鼠标与键盘操作细节继续打磨
  • Debug Console 的交互、错误恢复、重连和长期资源稳定性验证
  • Windows UI 与平台传输接线不在当前开发阶段

@1lck

1lck commented Aug 29, 2026

Copy link
Copy Markdown
OwnerAuthor

本轮 Debug 变量分页已推送,提交:419c244b feat(debug): page large variable trees。

进展:

  • Rust Core 接通 DAP variables 的 filter/start/count,并校验参数。
  • scopes、variables、evaluate、setVariable 统一输出 namedVariables/indexedVariables。
  • macOS 变量树按每页 100 项加载,支持 named/indexed 分段、树内 Load more、剩余数量和加载状态。
  • 增加 Adapter 忽略分页时的重复页保护,以及切换栈帧后的旧响应隔离。
  • 新增共享契约夹具和文档;Windows 未修改。

验证:Rust Core 286 项通过;macOS 696 项、80 个套件通过;DebugModuleTests 20 项通过且完成计时;共享契约、架构边界、Rust 注释规范均通过。

PR 继续保持 Draft/WIP,后续继续完善 macOS Java Debug。

@1lck

1lck commented Aug 30, 2026

Copy link
Copy Markdown
OwnerAuthor

Java Test Debug 进度同步:

  • macOS Tests 面板已接通 JUnit/TestNG 的真实 Debug 启动流程。
  • JDT LS 负责解析测试文件、类、方法、classpath、工作目录和 runner 参数。
  • Rust Core 新增 debug.javaTestLaunch,统一归一化 Java DAP 启动配置;args / vmArgs 按 Java Debug Adapter 要求输出。
  • 测试结果监听器仅在启动 Java 测试调试时创建,并覆盖取消、失败、自然结束、项目关闭和运行时重载清理。
  • 已验证 JUnit/TestNG 真实断点、变量读取和继续运行。
  • Windows 端未接线、未修改,等 macOS 稳定后再复用 Rust Core 合同接入 UI。

本次提交:4e8dadf1 feat(debug): add Java test debugging workflow

验证:

  • macOS:710 tests / 82 suites,23.275s
  • Rust Core:291 unit tests + 5 integration tests
  • verify-core.sh
  • verify-rust-core.sh
  • verify-service-boundaries.sh
  • verify-shared-contracts.sh
  • verify-windows-boundaries.sh
  • verify-test-stability.sh
  • 真实 JUnit Debug:3.378s
  • 真实 TestNG Debug:3.119s

PR 保持 Draft,功能仍在开发中。

@1lck

1lck commented Aug 30, 2026

Copy link
Copy Markdown
OwnerAuthor

Progress update (2026-08-30):

  • Stabilized the real Spring Java debug integration test by using an explicit loopback port and HTTP readiness probing; integrated PTY output is not routed through Debug Console output.
  • Corrected the run-configuration integration assertion to read Maven JVM arguments from extensions.maven.jvmArguments.
  • Verified: ./scripts/verify-rust-core.sh passed (301 Rust Core tests plus bridge/build checks). The macOS suite and test-stability checks were also passing before this commit.
  • Scope remains macOS + shared Rust Core; Windows is intentionally unchanged.
  • PR remains draft/WIP.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@1lck