Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: debugger #2

Open
JeanJPNM opened this issue Oct 28, 2024 · 1 comment
Open

feat: debugger #2

JeanJPNM opened this issue Oct 28, 2024 · 1 comment

Comments

@JeanJPNM
Copy link
Owner

Just like there is the language server protocol to have cross editor support for language features, there also is the debug adapter protocol, which allows any editor to communicate with any protocol-compliant debugger.

The main idea is to create a java mindustry mod with functionality similar to already existent logic debuggers such as deltanedas/ldb that communicates with another process through a websocket connection.

graph TD
  pkg["Package"]
  mod["Mindustry Mod"]
  editor["Editor"]
  editor -->|debug adapter protocol| pkg -->|json messages| mod
Loading

I may cut the middleman if putting the DAP functionality directly on the mod takes less effort and doesn't force me to reimplement features already present on the language server.

I still need to investigate what would be the limitations of this approach, a few that come to mind are:

  • May need to pause the game when a processor hits a breakpoint
  • Limited or no support to conditional breakpoints
  • Debugging is likely to change the behavior of scripts that frequently interact with the world
@JeanJPNM
Copy link
Owner Author

The debugger could also support sourcemaps to allow users to debug code generated by tools such as mlogjs and mindcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant