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

Implement support for remote debugging already-exported projects #11619

Open
CsloudX opened this issue Jan 21, 2025 · 3 comments
Open

Implement support for remote debugging already-exported projects #11619

CsloudX opened this issue Jan 21, 2025 · 3 comments

Comments

@CsloudX
Copy link

CsloudX commented Jan 21, 2025

Describe the project you are working on

A Game can load mods[I GURESS]

Describe the problem or limitation you are having in your project

There was MainApp.exe that can load mods(maybe pck files).
this mods files can make any peoples, just the pck's content was a valid struct. like:
PCK file
| - <mod_id>.gd
| - func init_mode()
| - func tick_mode()

for other people, them don't have the MainApp.exe's Godot project, so them can't debug the mode.

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

Add a 'Remote debug Application' option in Debug menu.

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

when click 'Remote debug Application', Godot start the MainApp.exe(Maybe request export with debug)
this step, Godot Editor will auto start debugger to MainApp.exe
the MainApp.exe with auto load the mods pck file(this was implement by the MainApp.exe)
then, i can't debug my mod, Oh Ye.

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

I'm try write gds like this:

@tool
extends EditorScript

func _run() -> void:
	var dir = DirAccess.open("")
	var path = dir.get_current_dir().path_join("Build/ExportTest.exe")
	var id = OS.create_process(path,["--remote-debug","tcp://127.0.0.1:6007"])
	prints(id)

it can connect the debugger. but it can't trigger my breakpoints. i don't know why.

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

If there was a add-on, i like it too. but i prefer like it can be core.

ADDTION:
It very like exe load a dll.
exe --> MainApp.exe
dll --> mod(pck file)
with Visual Studio, I can start the exe for debug my dll

@Calinou Calinou changed the title Implement remote debug exported exe. Implement support for remote debugging already-exported projects Jan 21, 2025
@Calinou
Copy link
Member

Calinou commented Jan 21, 2025

This requires the project in question to be exported with debugging enabled, which has a performance and binary size penalty.

I don't think we should be encouraging authors of moddable games to export their projects with debugging enabled for this reason.

@KoBeWi
Copy link
Member

KoBeWi commented Jan 21, 2025

You can ship the project with both debug and release executables, the PCK file takes the most space anyway and it's usually the same for both.
Although AFAIK debugger (or at least part of it) still exists in release builds, but it's disabled if you don't start debugging session.

@CsloudX
Copy link
Author

CsloudX commented Jan 22, 2025

For debug, may request enable 'Export with Debug', the size maybe bigger, IMO, we accept this. for release version(uncheck Export with debug), it can't remote debug.

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

3 participants