godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.52k stars 149 forks source link

Debug launch doesn't do anything with no error. (Godot 4.1) #481

Closed wrightwriter closed 10 months ago

wrightwriter commented 1 year ago

Godot version

4.1.stable.mono

VS Code version

1.73.1

Godot Tools VS Code extension version

1.3.1

System information

Windows 10

Issue description

The debug port is the same as the one in godot (default 6007). Play button inside Godot launches the game fine. LSP stuff works fine as well.

    {
      "name": "Play GDSpt",
      "type": "godot",
      "request": "launch",
      "project": "${workspaceFolder}",
      "port": 6007,
      "address": "127.0.0.1",
      "launch_game_instance": true,
      "launch_scene": false
    },

VSCode looks as if it's debugging. image

Steps to reproduce

Install extension, set godot executable and ports, create launch.json configuration, start debugging session.

wrightwriter commented 1 year ago

same issue in non-mono Godot 4.1

Stellanora64 commented 1 year ago

I believe the 4.x debugger is still WIP.

PR: #452

DeadlandStrider commented 11 months ago

Hello Y'all, I was able to fix this issue with the following change to my launch.JSON file on LINUX... I don't know if it will work in Windows... I hope this is helpful :D

{
  "name": "Play GDSpt",
  "type": "godot",
  "request": "launch",
  "project": "${workspaceFolder}",
  "port": 6007,
  "address": "tcp://127.0.0.1",    <<---Godot 4.1  requires the "--remote-debug" flag to have the tcp protocol before the ip address 
  "launch_game_instance": true,
  "launch_scene": false
}
grtwje commented 11 months ago

I tried adding the "tcp://". The game starts, but the breakpoint is not hit. When I exited they game, I got:

ERROR: Remote Debugger: Unable to connect. Status: 1. at: connect_to_host (core/debugger/remote_debugger_peer.cpp:182)

(Godot_4.1.1-stable_win64 on Windows 11 Home 22H2)

grtwje commented 10 months ago

I resolved my issue by following suggestions in #389. It took me a few tries with some editor restarts, but eventually breakpoints started working (probably had to allow some bogus network connection to time out).

Calinou commented 10 months ago

Thanks for the report! Consolidating in https://github.com/godotengine/godot-vscode-plugin/issues/389.