godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.58k stars 169 forks source link

Not able to use breakpoints #468

Closed maziac closed 1 year ago

maziac commented 1 year ago

Godot version

4.0.2.stable

VS Code version

1.77.3

Godot Tools VS Code extension version

1.3.1

System information

macOS

Issue description

I was able to attach the language server and also start the debugger. However none of the breakpoints is hit. The project runs in Godot debugger without stopping. Here is the launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "GDScript Godot",
            "type": "godot",
            "request": "launch",
            "project": "${workspaceFolder}",
            "port": 6007,
            "address": "http://127.0.0.1",
            "launch_game_instance": true,
            "launch_scene": false
        }
    ]
}

One note: I had to add "http://" or at least "://" to the "address", otherwise it starts with an error: Bildschirmfoto 2023-04-26 um 20 04 58

If run directly from command line there is more error output:

% "/Volumes/SDDPCIE2TB/Applications/Godot.app/Contents/MacOS/Godot" --path "/Volumes/SDDPCIE2TB/Projects/Godot/golf" --remote-debug 127.0.0.1:6007 --breakpoints res://arrow.gd:30,res://camera.gd:30,res://camera.gd:36 
Invalid debug host address, it should be of the form <protocol>://<host/IP>:<port>.

What would be the correct form and how to enter it in launch.json?

Steps to reproduce

Launching the debugger from vscode.

thoraxe commented 1 year ago

In address you should be using tcp:// and not http:// I think.

maziac commented 1 year ago

Ok, I used "tcp://" now. But still it does not stop at breakpoints. When I used the command from the command line I found that probably the port is wrong:

% "/Volumes/SDDPCIE2TB/Applications/Godot.app/Contents/MacOS/Godot" --path "/Volumes/SDDPCIE2TB/Projects/Godot/golf" --remote-debug tcp://127.0.0.1:6007 --breakpoints res://arrow.gd:30,res://camera.gd:30,res://camera.gd:36
ERROR: Remote Debugger: Unable to connect. Status: 3.
   at: connect_to_host (core/debugger/remote_debugger_peer.cpp:180)
Godot Engine v4.0.2.stable.official.7a0977ce2 - https://godotengine.org

6008 seems to work better:


% "/Volumes/SDDPCIE2TB/Applications/Godot.app/Contents/MacOS/Godot" --path "/Volumes/SDDPCIE2TB/Projects/Godot/golf" --remote-debug tcp://127.0.0.1:6008 --breakpoints res://arrow.gd:30,res://camera.gd:30,res://camera.gd:36 
Godot Engine v4.0.2.stable.official.7a0977ce2 - https://godotengine.org

(BTW where can I get the information which port to use?)

But even with that port, no stop at breakpoints.

Anything else I could try?

DaelonSuzuka commented 1 year ago

Godot 4 debugger support isn't finished yet, and I wouldn't expect this to work properly today.

maziac commented 1 year ago

OK. Is there a timeline, e.g. is it about days or months? I'm thinking if it makes sense to downgrade to Godot 3.

thoraxe commented 1 year ago

https://github.com/godotengine/godot-vscode-plugin/issues/389 describes workarounds, but they're sloppy right now. There is a reference to a WIP PR. I would say it's probably weeks and not months, but this is open source and we're at the mercy of (often) people's free time.

If flawless non-hacky debugger support is critical for you right now, then yes, you should downgrade to Godot 3.x

maziac commented 1 year ago

Thanks for info.

Calinou commented 1 year ago