You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8f2983d
Browse filesBrowse the repository at this point in the historyBrowse files
* fix(#355,#363,#357,#353): misc adapter fixes — mock function-bp reason, Docker rust/cpp sourceMap derivation, ruby attach sync guidance, dotnet attach pause
- #355: mock adapter now reports stop reason 'function breakpoint' (with
hitBreakpointIds) when a function breakpoint is hit; line breakpoints keep
'breakpoint' and also carry hitBreakpointIds. When a line and a function
breakpoint share a line, the plain line breakpoint wins the tiebreak.
DAP-level tests spawn the compiled process over TCP.
- #363: host-built rust/cpp binaries debugged in the container never bound
file+line breakpoints (host DWARF paths vs /workspace). New
deriveSourceMapFromBinary in @debugmcp/codelldb-common scans the binary for
embedded absolute path strings and derives hostPrefix -> workspaceRoot
sourceMap entries (rustc std-lib paths and no-op mappings excluded, capped
at 3, ranked by match count). Wired into rust/cpp transformLaunchConfig for
container mode with prebuilt binaries only; caller-supplied sourceMap always
wins. Docs added for both languages with the manual sourceMap fallback.
- #357: the ruby attach live-sync warning for rdbg's "<path> is not available"
now appends topology guidance (target-side paths, localfsMap) instead of
just scaring; launch sessions and other languages unchanged. Ruby docs gain
an "Attaching across a container boundary" subsection.
- #353: reproduced on Linux — netcoredbg does not suspend the target on
attach, so the session reported PAUSED while the debuggee kept running:
stackTrace failed with 0x80131302 (process not synchronized) and
pause_execution short-circuited with "Already paused". DotnetAdapterPolicy
now declares getAttachBehavior pauseAfterAttach (same contract as
python/ruby/js), making the post-attach PAUSED state real. New dotnet
attach-by-PID e2e smoke test (self-skips without netcoredbg).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix: CI fixes — bind mock DAP test to 127.0.0.1; scrub example home paths
- mock-adapter-process test passes --host 127.0.0.1: the default
'localhost' bind can resolve to ::1 on CI runners while the client
dials 127.0.0.1 (ECONNREFUSED x4 on ubuntu CI)
- replace /home/you and /home/host examples with /home/user to satisfy
the personal-path audit
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix: linear-time path splitting (CodeQL js/polynomial-redos); skip g++ fixtures on win32
- split on a single separator char + filter instead of /[\\/]+/ over
binary-derived strings; trailing-separator strip without a regex
- the derive fixtures only exercise a Linux-container feature; MinGW's 8.3
short paths (C:\Users\RUNNER~1\...) made them unstable on Windows CI
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: CI Bot <ci@example.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
- The launch default `"uncaught"` sets **no filter**: LLDB has no uncaught-only C++ filter, and an uncaught exception reaches `std::terminate` → SIGABRT, which the debugger stops on natively — you still land at the crash with stack and locals.
95
95
-`cpp_catch` (break on catch) is available via explicit filter configuration.
96
96
97
+
## Debugging host-built binaries in Docker
98
+
99
+
A binary compiled on the host embeds host-absolute source paths (e.g. `/home/user/proj/src/main.cpp`) in its DWARF debug info. When the mcp-debugger container mounts the project at `/workspace`, breakpoint requests use `/workspace/...` paths and CodeLLDB cannot match them against the DWARF paths — file+line breakpoints and logpoints silently never bind (function breakpoints and pause still work; issue #363).
100
+
101
+
In container mode (`MCP_CONTAINER=true`) the adapter auto-derives a best-effort `sourceMap` for prebuilt binaries by scanning the binary for embedded host paths whose suffixes exist under the workspace mount (`MCP_WORKSPACE_ROOT`, default `/workspace`), so this usually just works. If auto-derivation misses (unusual layouts, stripped path strings), pass the mapping explicitly — a caller-supplied `sourceMap` always wins:
102
+
103
+
```json
104
+
{
105
+
"scriptPath": "/workspace/build/app",
106
+
"dapLaunchArgs": {
107
+
"sourceMap": { "/home/user/proj": "/workspace" }
108
+
}
109
+
}
110
+
```
111
+
112
+
Alternatively, compile inside the container (or with `-fdebug-prefix-map=/home/user/proj=/workspace`) so the DWARF paths match the mount directly.
113
+
97
114
## Troubleshooting
98
115
99
116
-**"CodeLLDB executable not found"** — run `pnpm --filter @debugmcp/codelldb-common run build:adapter`, or set `CODELLDB_PATH`.
Copy file name to clipboardExpand all lines: docs/rust-debugging.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,6 +291,23 @@ Response will show Rust types clearly:
291
291
}
292
292
```
293
293
294
+
## Debugging host-built binaries in Docker
295
+
296
+
A binary built by `cargo build` on the host embeds host-absolute source paths (e.g. `/home/user/proj/src/main.rs`) in its DWARF debug info. When the mcp-debugger container mounts the project at `/workspace`, breakpoint requests use `/workspace/...` paths and CodeLLDB cannot match them — file+line breakpoints silently never bind (function breakpoints and pause still work; issue #363).
297
+
298
+
In container mode (`MCP_CONTAINER=true`) the adapter auto-derives a best-effort `sourceMap` for prebuilt binaries by scanning the binary for embedded host paths whose suffixes exist under the workspace mount (`MCP_WORKSPACE_ROOT`, default `/workspace`). If derivation misses, pass the mapping explicitly — a caller-supplied `sourceMap` always wins:
299
+
300
+
```json
301
+
{
302
+
"scriptPath": "/workspace/target/debug/myapp",
303
+
"dapLaunchArgs": {
304
+
"sourceMap": { "/home/user/proj": "/workspace" }
305
+
}
306
+
}
307
+
```
308
+
309
+
Alternatively, build inside the container (or with `RUSTFLAGS="--remap-path-prefix=/home/user/proj=/workspace"`) so the DWARF paths match the mount directly.
0 commit comments