-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Support for debugging GDNative #675
Comments
Yeah, that's probably not gonna happen. It took me more than six months to update the GDScript debugger for Godot 4, and "all" that's doing is translating messages from Godot's debug socket into a form that VSCode understands. Add to that the fact that I don't really know anything about GDNative, I have no plans to use GDNative in my personal projects, and I expect very few people would ever use this feature... The return on investment just isn't there. |
Ok. Well, I guess that is what it is. For anyone who does use GDNative (or as it's called in Godot 4, GDPlugins) the problem wasn't too hard to solve. You need the CodeLLDB plugin installed to VSCode (which is recommended by Godot anyway) and if you're running on a recent mac, you need to follow the steps outlined in https://docs.godotengine.org/en/stable/contributing/development/debugging/macos_debug.html in order to attach to a running Godot instance. With that done, the following launch.json solves the issue:
Set up "godot-complete-launch" as your default and then F5 will launch this plugin as usual, but also attach an LLDB session to it, so you can debug the C++ code in your plugin. Note: If you compile Godot from source, you can even debug Godot this way (not that you would want to do that). |
Does this create two separate debug sessions or are they somehow merged together? |
One session. This plugin launches godot and handles all that magick it does. LLDB (or GDB works on windows) attaches to the already running process and is the standard way to debug any C or C++ program, so yeah... It just works out of the box |
Godot version
3.5
VS Code version
1.90.2 universal
Godot Tools VS Code extension version
2.0.0
System information
MacBook Pro M1 with Sonoma OS
Problem statement
I want to be able to step into my GDNative code while debugging. I used to be able to make this work on my Intel mac, but it was quite a hassle. Now that the this plugin exists, working with Godot is beautifully simple, except the plugin doesn't automatically allow you to step into my GDNative code. Now I have to find a wacky workaround, which is harder than ever with the universal build of Godot running on an Apple Silicon. I suppose I'll have to create a task that launches lldb-mi, finds the running process of godot and attaches to it for debugging into my GDNative code. This would be so much nicer if it was just a working feature of the plugin.
Proposed solution
Make sure to attach to any GDNative plugins that are running as part of the scene?
The text was updated successfully, but these errors were encountered: