start_debugging
Launch a script under a debugger and determine whether it paused, stopped, or is still running, returning the stop reason, breakpoint location, and source context.
Instructions
Start debugging a script. Answers when the launched program stops, when it ends, or after a short hold — whichever comes first, and the same way in every language: "paused" with a reason and, as wait_for_stop answers a stop, the location, its source context and a note (a breakpoint reached as the program starts is answered here), "stopped" with the exit code, or "running" with pending:true when the program has not stopped yet; the message says what is armed. The hold is not a limit on the program — nothing is cancelled when it passes and breakpoints stay armed: call wait_for_stop to block until the program stops or ends (for a server, after sending the request that reaches your breakpoint). A stopOnEntry launch is answered at its entry stop
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | ||
| sessionId | Yes | ||
| scriptPath | Yes | Path to the script to debug. Use absolute paths or paths relative to your current working directory | |
| testRunner | No | Run scriptPath under a test runner the language declares a preset for (list_supported_languages shows testRunners per language; python: "pytest"). The preset builds the launch — for pytest: python -m pytest <scriptPath>[::testTarget] -x, run from pytest's rootdir (the nearest pytest.ini, pyproject.toml with a [tool.pytest.ini_options] table, tox.ini or setup.cfg with a pytest section above the file, else setup.py), with pytest-xdist and pytest-cov turned off — -p no:<plugin>, or the plugin's inert switch (-n0 / --no-cov) when the project's own addopts turns it on — unless your args ask for them, and the debugger armed to pause on the first failing assert or escaping exception with the test frame live (uncaught + userUnhandled). The answer is the autopsy: snapshot.exception, frames and locals; a passing test runs to completion. Your args are appended as pytest arguments. An undeclared runner is refused by name before anything starts | |
| testTarget | No | With testRunner: the test inside scriptPath to run — "test_name", "Class::test_name", "test_name[param]" — or a full node id of that file. Omit to run the whole file | |
| dryRunSpawn | No | Check the launch without starting anything: resolves the adapter and the program (compiling a source-file program where the language needs it), runs the launch transform, and answers with the adapter command the launch would run plus any configuration warnings. The session is left exactly as it was: the answer's state is the session's current state, a running or paused program keeps running, and the previous run's output, exit code and last stop stay readable. Not available for attach-shaped configs | |
| dapLaunchArgs | No | DAP launch arguments. Beyond the three below, adapter keys pass through (program, cwd, env, …). Python: module runs `python -m <module>` instead of scriptPath (the pytest shape: module "pytest", args [<test file>::<test>, "-x"]) and code runs a code string; scriptPath then only names the file the launch is about, and cwd — which `python -m` puts on sys.path — defaults to the directory above the top-most package containing scriptPath | |
| breakOnExceptions | No | Break when exceptions are thrown: "uncaught" pauses at uncaught exceptions at the crash site instead of terminating the session; "all" also pauses on caught/raised exceptions (language-dependent). Launch sessions default to "uncaught" (Ruby is the exception — rdbg has no uncaught-only filter, so it stays "none"); pass "none" to opt out and let crashing scripts run to termination | |
| adapterLaunchConfig | No | Optional adapter-specific launch configuration overrides |