Skip to content

feat: mature lldb agent harness#245

Draft
AiMiDi wants to merge 5 commits intoHKUDS:mainfrom
AiMiDi:lldb-agent-harness
Draft

feat: mature lldb agent harness#245
AiMiDi wants to merge 5 commits intoHKUDS:mainfrom
AiMiDi:lldb-agent-harness

Conversation

@AiMiDi
Copy link
Copy Markdown
Contributor

@AiMiDi AiMiDi commented Apr 24, 2026

Description

Matures the existing LLDB harness into the v1.0 AI debugging adapter layer.

This PR adds a formal stdio Debug Adapter Protocol entry point (cli-anything-lldb-dap) while keeping the existing JSON CLI and REPL workflows intact. It hardens the persistent CLI session daemon, makes unresolved breakpoints honest by default, expands stop/process/source/disassembly metadata, and updates the agent-facing docs for DAP and persistent-session workflows.

Follow-up GUI/debugger responsiveness improvements are included: DAP continue now returns before blocking LLDB continue completes, pause uses async interrupt, and breakpoint mutation during active continue first interrupts and waits for a stopped state. launch/attach support the compatibility autoContinueInternalBreakpoints flag for known debugger-internal JIT/startup stops.

Latest iteration adds structured DAP stop rules and external profile files. Targets such as C4D can inject rules matching reason, module, function, and/or regex; rules can either classify a stop or auto-continue it. DAP stopped events now expose body.cliAnythingStop.origin (manualPause, internalTrap, or debuggee) with matched-rule and frame/module/function metadata, so AI clients can distinguish a requested pause from NVIDIA/C4D/internal traps. Existing running cli-anything-lldb-dap processes do not hot-load profile/code changes; clients must restart the adapter and re-attach/re-launch.

Skip/testing note: the current local Windows run has 0 skipped tests. Earlier local runs could skip the optional core-load negative-path scenario when LLDB_TEST_CORE was unset; after rebasing onto current main, that test now uses a placeholder fixture, so no skip waiver is needed in this PR.

Type of Change

  • New Feature — adds new functionality to an existing harness or the plugin
  • Bug Fix — fixes incorrect behavior
  • Documentation — updates docs only

Checklist

  • Code follows existing patterns and conventions
  • Existing JSON CLI / REPL workflows remain intact
  • DAP stdout remains protocol-only; diagnostics go to stderr or log files
  • Commit messages follow the conventional format (feat:, fix:, docs:, test:)
  • I have tested my changes locally

Test Results

# Windows local environment, from lldb/agent-harness
$ python -m py_compile cli_anything\lldb\dap.py cli_anything\lldb\core\session.py cli_anything\lldb\lldb_cli.py
passed

$ python -m pytest cli_anything\lldb\tests\test_core.py -q
46 passed in 0.30s

$ python -m pytest cli_anything\lldb\tests -q -rs
53 passed, 2 warnings in 40.36s
Warnings are LLDB SWIG DeprecationWarning messages from the local LLDB Python bindings.
Skip status: 0 skipped.

# Repository-level skill mirror check
$ python .github\scripts\validate_root_skills.py
Root skills validation passed.

$ git diff --check
passed, with Windows CRLF normalization warnings only

@AiMiDi AiMiDi marked this pull request as ready for review April 24, 2026 09:56
@AiMiDi AiMiDi marked this pull request as draft April 24, 2026 10:33
@yuh-yang
Copy link
Copy Markdown
Collaborator

Thanks for the Apr 27/28 updates. The DAP responsiveness and stop-rule additions are useful.

I checked the current head (f773006) and the attach issue still looks open: _handle_attach() still requires program/executable before it accepts pid/processId. Common DAP attach configs often provide only a process id, and LLDB can attach that way, so please support pid-only attach or document the stricter schema clearly.

Since the PR is still draft, I would also keep the real-client smoke checklist before marking ready: initialize, attach/launch, breakpoints, configurationDone, threads, stackTrace, variables, continue, and disconnect.

Sign up for free to 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.

2 participants