No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christoph 4a13bf8920
Some checks failed
Test and publish Python package / Test and build (release) Has been cancelled
Test and publish Python package / Publish to Forgejo PyPI (release) Has been cancelled
Update .gitea/workflows/package.yml
2026-09-26 20:36:12 +00:00
.gitea/workflows Update .gitea/workflows/package.yml 2026-09-26 20:36:12 +00:00
src/nxdebugger refactor(core): adjust log messages formatting 2026-09-02 08:46:10 +02:00
tests ci(package): add workflow to test and publish to Gitea PyPI 2026-08-26 00:27:35 +02:00
.gitignore refactor(src): move package into src layout 2026-08-25 22:41:37 +02:00
.python-version chore(pyproject): lower Python requirement to 3.12 and remove nxdebugger script 2026-08-25 22:47:48 +02:00
LICENSE Initial commit 2026-08-23 22:02:09 +00:00
pyproject.toml ci(package): add workflow to test and publish to Gitea PyPI 2026-08-26 00:27:35 +02:00
README.md Update README.md 2026-09-07 18:46:36 +00:00
uv.lock ci(package): add workflow to test and publish to Gitea PyPI 2026-08-26 00:27:35 +02:00

Debugging NX with VS Code

This debugger communicates with VS Code directly through the Debug Adapter Protocol (DAP). It does not load debugpy, pydevd, Cython extensions, or debugger background threads into the NX process. This makes it suitable for the short-lived Python subinterpreter used by the NX MOM adapter.

Start

  1. Close every running NX process. This is important after an earlier debugpy process-ID attach because its modules remain loaded until that process exits.
  2. Start the post run in NX. MOM_start_of_program waits up to 60 seconds for VS Code.
  3. Open Run and Debug in VS Code, select NX: Thread-free DAP Debugger, and press F5.
  4. Set breakpoints in the post file or imported Python modules.

To post normally, start NX without NX_DAP_DEBUG=1. No port is opened and the post does not wait for a debugger in that mode.

Supported features

  • Breakpoints, conditions, hit conditions, and logpoints
  • Continue, Step Into, Step Over, and Step Out
  • Call Stack, Locals, Globals, and nested values
  • Watch expressions and Debug Console evaluation
  • Break on raised Python exceptions
  • Synchronous cleanup from MOM_end_of_program and through atexit

Limitations

The adapter deliberately operates only on the current MOM Python thread. A Pause request is therefore processed at the next Python trace event. Python cannot be interrupted immediately while NX spends a long time in native C/C++ code. The initial implementation supports one Python thread.

Diagnostics are written to nx_dap_debugger.log next to the debugger files.

Package releases

Gitea Actions tests and builds the package on pull requests. Publishing a Gitea release additionally publishes the distributions to the Gitea PyPI registry. The package version is taken from the release tag; both v0.1.0 and 0.1.0 result in package version 0.1.0.

Push the release tag without changing the version in pyproject.toml:

Then create and publish a Gitea release for that tag. Draft releases do not publish a package.

Before publishing, create a personal access token for the repository owner with the write:package scope and store it as the repository Actions secret PYPI_TOKEN.