-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Unable to launch debugger with Godot 4 (workaround included) #389
Comments
I don't think they added Godot 4 support for this addon yet and a lot of things has changed between 3 and 4. Your best bet might be to wait for 4.0 to be released. |
Just to make sure I'm not doing something wrong, after all the setup, I also get So Godot 4.0 is still not support right? |
LSP is for autocompletions, not debugging. |
The input flags has changed and now requires a port to launch with remote debugging. By trying to launch it form a terminal you get this error: PS> Godot_v4.0-beta2_win64.exe --path "....\Godot\PROJECT" --remote-debug 127.0.0.1:6008
Invalid debug host address, it should be of the form <protocol>://<host/IP>:<port>. I tested a none real protocole and it seems launches PS> Godot_v4.0-beta2_win64.exe --path "....\Godot\PROJECT" --remote-debug any://127.0.0.1:6008
Godot Engine v4.0.beta2.official.f8745f2f7 - https://godotengine.org
Vulkan API 1.2.0 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 970
--------------------------------
... Adding the same fake protocole to the address field in launch.json launches a debug window but workout working breakpoints. Edit: Chaning the protocol to tcp and prot to 6006 breakpoints stops the runtime but gives not feedback in vscode. looks like 6006 is the defualt debug adapter port not |
I was able to adjust the launch.json and use the tcp port like you mentioned, and get the editor to launch, but I get some strange errors, and the debugger doesn't work still. I don't expect things to work prior to Godot 4 launch, just interesting and thought I'd share the error.
|
Check your remot debugging port really is 6007 Project -> Network -> Debug Adapter I have not gotten brakeponts working ether but I got it to lunch. |
@yoieh Oh, yeah I got the software to launch, just no breakpoints, which is hard to sell because if I'm going to use it as a primary editor, and I can't debug, that's a pretty big issue for me personally. If you change the external editor, I don't think there's even a way to set breakpoints in the godot editor either, so you can't even use VSC for coding and godot for debugging super well, other than by kinda like, using VSC most times, and then just using Godot when you want to debug and not setting the external editor. I'll play around with it, but mostly going to wait for debugging to come back for now, but thanks for the notice! |
Hey guys!
As for You might have to launch your game in Running on |
Thanks @Winprox , I can confirm that in And I think you meant So to summarize, To get VSCode GDScript debugging working in
|
@michaelgundlach I've followed these instructions and @Winprox's multiple times to the letter but debugging from On further inspection this error occurs on
This definitely seems related to C#. |
Sorry @glimpsebeyond, I'm just using GDScript. I updated my comment to not disappoint C# users. If you figure it out ping me again and I'll update the comment again. |
@michaelgundlach I tried it using the godot build without C# and a new gdscript only project and the behavior is mostly unchanged, though it did resolve that error I posted the program does not open. |
@glimpsebeyond @michaelgundlach Edit: No idea how I caused the "Max client limits reached" errors. The vscode debugger either starts and stops or kills it if already started from the Godot editor. Edit: "Max client limits reached" errors seem to occur when changing launch.json while the Godot editor is connected. |
@michaelgundlach I was also seeing the I even tried going into the scripts menu and closing any open scripts, and even going into the "scripts" menu under "debug" and selecting "debug with external editor" and it still shows the error I also tried messing around with the ports as well, trying different ones, as well as making sure the Not sure what is still taking that port? I tried running a netstat, and only saw the listening ports from Godot looking at the ports specified for the debug server. Let me know if anyone finds anything else regarding this, I would of course like to use Vscode whenever possible for debugging, but for now, it's understandable as it's beta afterall |
I'm having a similar issue with respect to C# debugging. Looking in my VSCode terminal tab where the
The file
Not sure if this warrants a separate issue. Here's my launch config:
Using the config specified in #389 (comment) does not make breakpoints work, but it doesn't produce the odd errors. I am setting a breakpoint, launching the editor from vscode, running the project in the editor after launching the editor from vscode, stopping the project, and then running the project again from VSCode. I'm on 4 Beta13. |
same issue with GDScript @thoraxe |
i followed the instruction that @michaelgundlach give earlier, works on Linux Mint, and have same error with @kkhhaann on WIndows 11 |
The "Max clients limit reached" error seems to happen after opening and closing the debug session 8 times. I assume the DAP server can only take 8 connections before it maxes out, and for some reason each time you try to debug from vscode it eats a new client. (I am using GDscript, so it doesn't seem to be exclusively C#) Also this can even happen with the language server if you open and close vscode 8 times. It maxes out the connections. Though this is not really a problem anyone is likely to run into. |
I'm also having the same issue, I can get the DAP connection but can't get breakpoints to work correctly. Or get it to run from VS code. |
Hi, I implemented the DAP backend in Godot quite a long time ago, and haven't really looked at it lately to check if it's working properly. I'll have a look regarding some issues reported here. One thing I've neglected to do was document how to configure Godot and text editors to use this protocol. I'll have a look and see if this could be added to Godot Docs. In the mean time, this comment and my GSOC report should have all the info you need to setup DAP through VSCode. |
Wow, I think this is exactly the information I needed to finish the Godot 4 debugger support PR. Thank you for the links. |
Launch debugger with Godot 4VSCode: VSCodium Version: 1.82.2 Things that are working for me:
Things that look like bad behaviors
launch.json*
The only setting I changed in Godot Editor:Editor>Editor Settings>Network>Debug Adaptor>"Sync Breakpoints""> On : True (tick the box) *note: the debugServer and port number are derived from the Debug Adaptor port number. What ever is set there is what you want to type into your launch.json. I hope this helps. It was extremely difficult to figure this out, so if you are a user having trouble hang in there. Maintainers/Devs: It seems like the original issue is resolved. BUT there are no instructions anywhere on how to properly configure godot gdscript and vscode to work with this plugin. Again it was extremely difficult to figure out what levers to pull and buttons to push to get everything working. So I suggest we get the docs updated and/or update the defaults to something closer to what works. Let me know if I can help out in anyway. Thank you for all your work on this. |
I started a dedicated section in Godot's docs to document this from Godot's side. |
@loteque This was the perfect solution. Excellent job outlining the steps in detail. I was missing a couple pieces I couldn't find. I now have fully functional debugging with breakpoints, watches... all of it inside VSCode. You are a god among men for this. Kudos!!! |
I spoke too soon. Apparently things are completely different in 4.1.2 because now breakpoints aren't being respected. I guess I'll go back to 4.1.1 until the Godot crew get their act together. |
Hey y'all, I'm on Windows 10, Godot version 4.1.2-stable, VS:Code 1.84.2, and godot-tools 1.3.1. My configuration in my launch.json looks like this:
Inside of Godot, I've enabled "Sync Breakpoints" in the DAP settings. When I run the debugger with at least one breakpoint set, or if I add/remove a breakpoint when the DAP session is running, I get the following error inside of the Godot output window: I searched for this error in the issues and didn't find anything. Would be interested if anyone has had this error and has fixed it! EDIT: I got breakpoints working shortly after posting this by disabling the external editor option. Previously, I was using VS:Code as my external editor, and after I disabled this, it appears that breakpoints are syncing back and forth between VS:C & the Godot editor, and the breakpoints are stopping with info inside of VS:C as well. The error I mentioned above still shows in the output when this happens though. |
I believe I stumbled on a fix for my situation. I use VSCode as my editor and I have it set as my external editor. I'm able to get debugging in VSCode with functional breakpoints by doing the following. In Godot editor: In VSCode: "configurations": [
{
"name": "Godot Debug",
"type": "godot",
"request": "launch",
"project": "${workspaceFolder}",
"port": 6007,
"debugServer": 6008,
"address": "127.0.0.1",
"launch_game_instance": true,
"launch_scene": false
}
] Hopefully this helps. |
@renodubois can you provide a code sample where you can trigger such issue? While I haven't been able to replicate your issue yet, I am noticing some unreliable behavior on Windows, and it might be due to my recent fix regarding path separators, which I'm debugging now. |
At least in Godot 4.2.1, port Here's the full {
"version": "0.2.0",
// https://github.com/godotengine/godot-vscode-plugin/issues/389#issuecomment-1806992798
"configurations": [
{
"name": "Godot Debug",
"type": "godot",
"request": "launch",
"project": "${workspaceFolder}",
"port": 6007,
"debugServer": 6006, // 6006 is the default, at least in Godot 4.2.1
"address": "127.0.0.1",
"launch_game_instance": true,
"launch_scene": false
}
]
} |
Shouldn't it be fixed already in 2.0 in master? |
Yeah, the original issue is definitely fixed in master. |
Hello, I'm adding my two cents here after searching how to connect VSCode to Godot :
|
Same issue in 4.2.1 |
It was not working for me, then: I noticed that I started the app with After I have run with I need to remove After ran with Sometimes I need to remove breakpoint, save scene to it be removed in fact. If I don't do that, every time I run startup command the breakpoint will be there. Sometimes I need to close godot aplication to put break points. If not they don't stop. Sometimes only when the scene is running. Sometimes it just don't stop no matter what I do. Sometimes it shows the error when I put the breakpoint while running the Scene ( Sometimes running the Scene it enable me to put breakpoint and the breakpoint stops (I run the scene in Godot using the button 'Run Project', it stopped and don't show vscode debug dialog box (continue, go next line, go inside), just stop at a line and I need to close the scene using the button 'Stop Running Project'). Sometimes I can put breakpoints but I can't remove (It is removed but when I play it is there). Solution for now is using debugger inside Godot. It's much more consistent, and it removes the breakpoint when I want. |
@DaelonSuzuka may I ask why isn't version 2.0 published to the extension store? All issues from this thread are fixed there, but people keep coming and commenting on "workarounds". |
@Exerionius I've been quite sick since late November and haven't completed everything I wanted to get done before publishing. I did request the current state of the repo be published as 1.4.0 pre-release, so I will follow up on that today. |
Well, I wish you getting well soon. |
Thanks @Exerionius! With the release of Anybody who's experiencing problems with the new debugger should open new issues. |
In case of anyone looking for C# workaround for debugging using Visual Studio Code, here is a basic boilerplate project: |
Godot version
4.0 alpha 10
VS Code version
1.68.1
Godot Tools VS Code extension version
1.3.1
System information
Windows 11
Issue description
Unable to launch a debugger with Godot 4, connection with GDScript language server works fine.
Godot instance was already running.
My analysis says that an "&" is missing from suffix of exe
Steps to reproduce
Try opening debug session with default generated launch.json from VS code
The text was updated successfully, but these errors were encountered: