{"slug": "acpdbg-let-the-agent-sit-at-the-debugger", "title": "acpdbg: let the agent sit at the debugger 🐛", "summary": "A developer built acpdbg, an LLDB assistant that lets AI agents directly interact with debugger data and control debugging sessions. The tool uses the Agent Client Protocol (ACP) to allow agents to run live debugger commands and optionally control execution, eliminating manual copy-paste of stack traces. It works as a standalone tool or an LLDB plugin, supporting agents like Copilot and Claude.", "body_md": "I had an idea, and it starts from a habit.\n\nLLM agents are genuinely good at **static analysis**: give them a backtrace and\n\nthe source around it, and they usually spot the bad pointer before I do. So what\n\ndo I actually do when a native program crashes? I copy the stack trace from the\n\ndebugger, paste it into the agent's context, then copy the source of the\n\nfunctions involved, paste again… I'm the transport layer between two programs\n\nthat both live on my machine.\n\nThat's the idea: **why not let the agent look at the lldb debug data itself —\nand even control the debugging?**\n\nI already wrote about [ACP, the Agent Client Protocol](https://phimage.github.io/blog/acp-copilot-xcode) —\n\nthe standard that lets any agent talk to any client. Usually the client is an\n\neditor. But nothing says it has to be. A debugger is a perfectly good ACP client\n\ntoo. So I built one.\n\n[ acpdbg](https://github.com/phimage/acpdbg) is an LLDB assistant. When your\n\nThe part I like most: the agent doesn't just read a frozen report. Through a\n\nsmall MCP tool bridge it can run *live* debugger commands against the stopped\n\nprocess — `bt`\n\n, `frame variable`\n\n, `p some_expr`\n\n— to confirm its hypothesis\n\ninstead of guessing. And with the opt-in **control mode**, it gets `step_over`\n\n,\n\n`continue_execution`\n\n, `set_breakpoint`\n\n… so it can debug like a human would:\n\nset a breakpoint, run to it, step, watch the state evolve.\n\nThe whole loop works offline with a bundled mock agent, nothing else to install:\n\n```\npip install acpdbg\ngit clone https://github.com/phimage/acpdbg && cd acpdbg/samples\nmake                # builds ./crash with -g\nacpdbg -- ./crash   # runs it; on the crash the agent explains\n```\n\nSwap in a real agent for real analysis:\n\n```\nacpdbg --agent copilot -- ./crash\n```\n\nReal output from that command:\n\n```\nacpdbg → copilot (investigating…)\n\nConfirmed live: `s` is 0x0000000000000000 — a NULL pointer — right where\nstrlen(s) dereferences it.\n\nRoot cause: in main, `name` is NULL when the program runs with no arguments,\nand describe() hands it to strlen() with no check.\n\nOne-line fix: return s ? strlen(s) : 0;\n```\n\nIt's also a plain LLDB plugin. Install it once:\n\n```\nacpdbg --install-lldbinit --agent copilot\n```\n\nand every lldb session — including **Xcode's debugger console** — gets new\n\ncommands. Stop anywhere (a crash, a breakpoint, a watchpoint) and just type:\n\n```\n(lldb) ask why is `retry_count` already 3 here?\n(lldb) copilot in one sentence, why did this stop?\n(lldb) claude what would you change to fix it?\n```\n\nEach installed agent gets its own command, so you can get a second opinion from\n\nanother model without touching the config.\n\nI don't claim this is *the* way to debug. It's an experiment: the interesting\n\npart for me is that ACP made it cheap to build — I wrote a client once, and\n\nevery ACP-speaking agent works with it, today's and tomorrow's. The same\n\nN×M collapse I liked about the protocol in editors, applied to a debugger.\n\nCode, docs, and caveats: [github.com/phimage/acpdbg](https://github.com/phimage/acpdbg).\n\nTell me where it breaks. 🐛", "url": "https://wpnews.pro/news/acpdbg-let-the-agent-sit-at-the-debugger", "canonical_source": "https://dev.to/phimage/acpdbg-let-the-agent-sit-at-the-debugger-47co", "published_at": "2026-07-11 11:08:35+00:00", "updated_at": "2026-07-11 11:14:26.305760+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models"], "entities": ["acpdbg", "LLDB", "ACP", "Copilot", "Claude", "Xcode"], "alternates": {"html": "https://wpnews.pro/news/acpdbg-let-the-agent-sit-at-the-debugger", "markdown": "https://wpnews.pro/news/acpdbg-let-the-agent-sit-at-the-debugger.md", "text": "https://wpnews.pro/news/acpdbg-let-the-agent-sit-at-the-debugger.txt", "jsonld": "https://wpnews.pro/news/acpdbg-let-the-agent-sit-at-the-debugger.jsonld"}}