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

Allow editor to only listen for incoming debug session without starting a new process #2608

Closed
HaSa1002 opened this issue Apr 15, 2021 · 3 comments · Fixed by godotengine/godot#69164

Comments

@HaSa1002
Copy link

Describe the project you are working on

I develop a networked game with a dedicated server. The game connects to the API to create a new room. The API spawns the server process with some commandline arguments that are used to set up the server. Afterwards the game connects directly to the newly created instance.

Describe the problem or limitation you are having in your project

Because of this design, the server project is not started from within Godot. The problem is, I still want to debug the server (in the end, it is the authority).

Describe the feature / enhancement and how it helps to overcome the problem or limitation

All I need is Godot starting it's debugger, but instead of spawning a new process only listens on the port.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Godot connects via network to the debugger (--remote-debug 127.0.0.1:6008 in most cases) and syncs the existing breakpoints via the --breakpointsargument. I would add a project setting to toggle whether Godot should start the application or if it should only listen for incoming connections. Once connected the editor has to sync the breakpoints in the same way it does for breakpoints added after start currently. The UI has to be updated accordingly to acknowledge that it is more of a listening and non listening state. (You can't stop the running process, as it is not owned by the editor). The alternative is adding a new button next to the run button as done with "Run in Browser".

If this enhancement will not be used often, can it be worked around with a few lines of script?

It may not be used often, but it cannot be worked around by script (as far as I know). You get a somewhat working solution by commenting the OS.execute(...) line in editor_run.cpp, but it is more of hack and lacks certain feature described above, but can be used as a workaround.

Is there a reason why this should be core and not an add-on in the asset library?

It is a core editor feature.

See also:
godotengine/godot#5108

@Calinou
Copy link
Member

Calinou commented May 6, 2022

@HaSa1002 Does godotengine/godot#60819 implement this?

@HaSa1002
Copy link
Author

HaSa1002 commented May 6, 2022

I think so but I haven't tested it. The project is not live anymore.

@rubenwardy
Copy link

rubenwardy commented Aug 19, 2022

I can confirm that --debug-server allows you to debug with --remote-debug, but only once - when the debug session ends, you need to restart Godot Editor for the debug server to open again

Test code:

flatpak run org.godotengine.Godot -e --path ~/dev/games/mygame/ --debug-server *:6007

./mygame.x86_64 --remote-debug 127.0.0.1:6007

This should be an option in the Editor GUI as well. Maybe Debug > [ ] Listen for remote debug sessions. It should then automatically start the debugger when a remote debug session connects

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

Successfully merging a pull request may close this issue.

4 participants