https://www.alternetsoft.com.au/blog/python-script-debugger-based-on-debug-adapter-protocol

Python and C/C++ debuggers based on Debug Adapter Protocol

Describes implementation of integrating Python and C/C++ executing and debugging into .NET applications based on Debugger Adapter protocol.
21 Apr 2021 2 min read

AlterNET Studio version 7 introduces IronPython scripting, a lightweight solution for integrating Python functionality into your .NET applications. While IronPython currently lacks support of popular libraries like NumPy, we’re actively developing alternatives for Python code execution and debugging.

Python Script Debugging via (DAP)

With that in mind, we started looking at implementing script debugging using native tools that support Debug Adapter Protocol (DAP), such as Python.

DAP is a standard that allows development tools to communicate with various debuggers through specialized programs called “Debug Adapters.” These adapters exist for many languages, including Python, C/C++, Java, and Lua.

We have created a Python debugger, which includes the following parts:

  • DAP-Based Python Script Debugger: This component runs within the application process and uses TCP/IP to exchange debugging commands and events with the application itself.

  • LangServer.org - based Python syntax parser, which enables features like auto-completion, go-to-definition, and finding references within the code editor.

  • The Python.NET package, that allows Python code to interact with .NET objects. We’ve demonstrated this by using the WinForms MessageBox class.

Python DAP Script Debugger

C/C++ Script Debugging via (DAP)

AlterNET Studio version 8 introduces fully implemented DAP-based debuggers for Python and C/C++.

Similar to the Python LSP-based parser, we’ve integrated an LSP-based parser for C/C++. This enables advanced text editing features, such as code completion, go-to-definition, and find all references, within your C/C++ code.

C/C++ DAP Script Debugger

Looking ahead, we’re committed to further expanding the range of supported languages for our DAP-based debuggers. This includes plans to add support for PowerShell and Java in the future.