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

The debugger doesn't show any data #699

Open
chsxf opened this issue Aug 19, 2024 · 23 comments
Open

The debugger doesn't show any data #699

chsxf opened this issue Aug 19, 2024 · 23 comments

Comments

@chsxf
Copy link

chsxf commented Aug 19, 2024

Godot version

4.3

VS Code version

1.92.2

Godot Tools VS Code extension version

2.1.0

System information

macOS Sonoma 14.6.1

Issue description

The debugger doesn't show any data (locals, members or globals) and watches are also not working. It is also impossible to update the list of watches while the debugger is running.

Steps to reproduce

  • Place a breakpoint in any GDScript
  • Run your game until reaching the breakpoint
  • The debugger panel in VSCode should be empty (except for the active scene and inspector)
@chsxf chsxf added the bug label Aug 19, 2024
@umutseven92
Copy link

Can confirm the same issue. Locals, members and globals are all empty. Same specs as the OP; Godot 4.3, Godot Tools 2.1.0, VSCode 1.92.2, Sonoma 14.6.1.

@DaelonSuzuka
Copy link
Collaborator

Share your launch.json.

@umutseven92
Copy link

I use the default launch.json.

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "GDScript Godot",
			"type": "godot",
			"request": "launch",
		}
	]
}

@chsxf
Copy link
Author

chsxf commented Aug 20, 2024

I have the same launch.json file as @umutseven92. I initially used the one that is created by default and that has a few more options (like debug_paths, ...), but the result was the same. I removed some options to see if the problem was going away, to no avail.

@Calinou
Copy link
Member

Calinou commented Aug 20, 2024

@umutseven92
Copy link

@Calinou As far as I can see, that issue was caused by Headless LSP being on, which isn't the case here.

@chsxf
Copy link
Author

chsxf commented Aug 21, 2024

In my case, the problem is present with or without Headless LSP

@periodyctom
Copy link

I'm experiencing the same issue with 4.3, not using any extra launch options:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "GDScript Godot",
            "type": "godot",
            "request": "launch",
            "project": "${workspaceFolder}",
            "address": "127.0.0.1",
            "port": 6007,
        }
    ]
}

I'm using VS Codium on x64 Linux if that helps narrow it down any.

@periodyctom
Copy link

Another thing I noted, it seems to hang on match statements, I can't step continue with F10 after it hits the end of a match block.

@n4nn31355
Copy link

n4nn31355 commented Sep 3, 2024

Godot version: 4.3
VS Code: 1.92.2
Godot Tools: 2.1.0

I have the same issue on one project, but it works on another.
The "launch.json" and vscode settings are the same for both projects.

I see an extension host errors when running project with issue.

Run without breakpoints. Value is always the same:

[error] RangeError: The value of "offset" is out of range. It must be >= 0 and <= 112. Received 116
	at boundsError (node:internal/buffer:88:9)
	at Buffer.readUInt32LE (node:internal/buffer:222:5)
	at Qc.decode_UInt32 (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:42169)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:38869)
	at Qc.decode_Array (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41384)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:40363)
	at Qc.decode_Array (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41384)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:40363)
	at Qc.get_dataset (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41034)
	at Zc.on_data (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:51357)
	at Socket.emit (node:events:519:28)
	at addChunk (node:internal/streams/readable:559:12)
	at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
	at Readable.push (node:internal/streams/readable:390:5)
	at TCP.onStreamRead (node:internal/stream_base_commons:191:23)

Run with breakpoint. Value depends on breakpoint.
First error happens on start, second only on breakpoint.

[error] RangeError: The value of "offset" is out of range. It must be >= 0 and <= 124. Received 128
	at boundsError (node:internal/buffer:88:9)
	at Buffer.readFloatForwards [as readFloatLE] (node:internal/buffer:534:5)
	at Qc.decode_Float32 (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41916)
	at Qc.decode_Vector3f (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:46401)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:39354)
	at Qc.decode_Array (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41384)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:40363)
	at Qc.decode_Array (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41384)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:40363)
	at Qc.decode_Array (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41384)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:40363)
	at Qc.get_dataset (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41034)
	at Zc.on_data (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:51357)
	at Socket.emit (node:events:519:28)
	at addChunk (node:internal/streams/readable:559:12)
	at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
	at Readable.push (node:internal/streams/readable:390:5)
	at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
2024-09-04 00:43:25.237 [error] RangeError: The value of "offset" is out of range. It must be >= 0 and <= 172. Received 176
	at boundsError (node:internal/buffer:88:9)
	at Buffer.readUInt32LE (node:internal/buffer:222:5)
	at Qc.decode_UInt32 (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:42169)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:38869)
	at Qc.decode_Array (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41384)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:40363)
	at Qc.decode_Array (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41384)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:40363)
	at Qc.decode_Array (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41384)
	at Qc.decode_variant (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:40363)
	at Qc.get_dataset (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:41034)
	at Zc.on_data (c:\Users\***\.vscode\extensions\geequlim.godot-tools-2.1.0\out\extension.js:214:51357)
	at Socket.emit (node:events:519:28)
	at addChunk (node:internal/streams/readable:559:12)
	at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
	at Readable.push (node:internal/streams/readable:390:5)
	at TCP.onStreamRead (node:internal/stream_base_commons:191:23)

Not sure how to debug it further at this point.

@umutseven92
Copy link

umutseven92 commented Sep 3, 2024

Just checked and I have the same error as @n4nn31355. This is when a breakpoint is hit:

2024-09-03 22:14:01.469 [error] RangeError: The value of "offset" is out of range. It must be >= 0 and <= 120. Received 124
	at boundsError (node:internal/buffer:88:9)
	at Buffer.readUInt32LE (node:internal/buffer:222:5)
	at Qc.decode_UInt32 (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:42169)
	at Qc.decode_variant (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:38869)
	at Qc.decode_Array (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:41384)
	at Qc.decode_variant (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:40363)
	at Qc.decode_Array (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:41384)
	at Qc.decode_variant (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:40363)
	at Qc.decode_Array (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:41384)
	at Qc.decode_variant (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:40363)
	at Qc.get_dataset (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:41034)
	at Zc.on_data (/Users/USERNAME/.vscode/extensions/geequlim.godot-tools-2.1.0/out/extension.js:214:51357)
	at Socket.emit (node:events:519:28)
	at addChunk (node:internal/streams/readable:559:12)
	at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
	at Readable.push (node:internal/streams/readable:390:5)
	at TCP.onStreamRead (node:internal/stream_base_commons:191:23)

A bit more. The issue seems to occur because it seems that we are exhausting the buffer while reading from Array values (debugger.umut is my logger):

[debugger.umut] DECODING COUNT
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14148, len: 116}
extensionHostProcess.js:148
[debugger.umut] DECODING ARRAY VALUES
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14152, len: 112}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14156, len: 108}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14168, len: 96}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14176, len: 88}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14184, len: 80}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14188, len: 76}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14200, len: 64}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14208, len: 56}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14212, len: 52}
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14264, len: 0}
extensionHostProcess.js:148
[debugger.umut] RangeError: The value of "offset" is out of range. It must be >= 0 and <= 14260. Received 14264
	at boundsError (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/buffer.js:88:9)
	at Buffer.readUInt32LE (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/buffer.js:222:5)
	at Zc.decode_UInt32 (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:42275)
	at Zc.decode_variant (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:38892)
	at Zc.decode_Array (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:41472)
	at Zc.decode_variant (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:40386)
	at Zc.decode_Array (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:41472)
	at Zc.decode_variant (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:40386)
	at Zc.decode_Array (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:41472)
	at Zc.decode_variant (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:40386)
	at Zc.get_dataset (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:41057)
	at Jc.on_data (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:51515)
	at Socket.emit (/Users/USERNAME/Development/godot-vscode-plugin/lib/events.js:519:28)
	at addChunk (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/streams/readable.js:559:12)
	at readableAddChunkPushByteMode (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/streams/readable.js:510:3)
	at Readable.push (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/streams/readable.js:390:5)
	at TCP.onStreamRead (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/stream_base_commons.js:191:23)
	at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {code: 'ERR_OUT_OF_RANGE', stack: 'RangeError: The value of "offset" is out of r…Trampoline (node:internal/async_hooks:130:17)', message: 'The value of "offset" is out of range. It must be >= 0 and <= 14260. Received 14264'}

extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14264, len: 0}
extensionHostProcess.js:148
[debugger.umut] Buffer(14264) [180, 55, 0, 0, 28, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 20, 0, 0, 0, 115, 99, 101, 110, 101, 58, 105, 110, 115, 112, 101, 99, 116, 95, 111, 98, 106, 101, 99, 116, 2, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 3, 0, 0, 0, 2, 0, 1, 0, 22, 8, 0, 176, 21, 0, 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 67, 104, 97, 114, 97, 99, 116, 101, 114, 66, 111, 100, 121, 50, 68, 0, 28, 0, 0, 0, 146, 0, 0, 0, …]
extensionHostProcess.js:148
[debugger.umut] {buffer: Buffer(14264), offset: 14268, len: -4}
extensionHostProcess.js:148
[debugger.umut] RangeError: The value of "offset" is out of range. It must be >= 0 and <= 14260. Received 14268
	at boundsError (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/buffer.js:88:9)
	at Buffer.readUInt32LE (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/buffer.js:222:5)
	at Zc.decode_UInt32 (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:42275)
	at Zc.decode_variant (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:38892)
	at Zc.decode_Array (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:41472)
	at Zc.decode_variant (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:40386)
	at Zc.decode_Array (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:41472)
	at Zc.decode_variant (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:40386)
	at Zc.decode_Array (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:41472)
	at Zc.decode_variant (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:40386)
	at Zc.get_dataset (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:41057)
	at Jc.on_data (/Users/USERNAME/Development/godot-vscode-plugin/out/extension.js:214:51515)
	at Socket.emit (/Users/USERNAME/Development/godot-vscode-plugin/lib/events.js:519:28)
	at addChunk (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/streams/readable.js:559:12)
	at readableAddChunkPushByteMode (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/streams/readable.js:510:3)
	at Readable.push (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/streams/readable.js:390:5)
	at TCP.onStreamRead (/Users/USERNAME/Development/godot-vscode-plugin/lib/internal/stream_base_commons.js:191:23)
	at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {code: 'ERR_OUT_OF_RANGE', stack: 'RangeError: The value of "offset" is out of r…Trampoline (node:internal/async_hooks:130:17)', message: 'The value of "offset" is out of range. It must be >= 0 and <= 14260. Received 14268'}

@n4nn31355
Copy link

The problem seems to appear when using typed arrays with built-in types.
Possible solution in #708

@n4nn31355
Copy link

n4nn31355 commented Sep 4, 2024

Code to reproduce:

class_name MainLevel extends Node3D

func _ready() -> void:
    Performance.add_custom_monitor("custom/the/test", _get_calculation_performance)

func _unhandled_input(event: InputEvent) -> void:
    if event.is_action_pressed("ui_cancel"):
        _register_monitor()

func _register_monitor() -> void:
    Performance.add_custom_monitor("custom/the/test_more", _get_calculation_performance)

func _get_calculation_performance() -> float:
    return 0

@m-radzikowski
Copy link

I confirm the problem is when you use typed arrays. Repro:

extends Node2D

var x := 1
var arr: Array[int] = []

func _ready() -> void:
	print(x)

With breakpoint on print(x), the variables are empty and selecting this node in active scene tree does not give details in the inspector window.

Changing Array[int] to Array fixes the issue and variables show.

@NathanNgo
Copy link

NathanNgo commented Sep 13, 2024

Having the same issue, and would love to get some traction on this issue, as I'd love to have the debugger working again on 4.3.

Is there a particular maintainer we should ping in regards to the PR by @n4nn31355?

@DaelonSuzuka
Copy link
Collaborator

DaelonSuzuka commented Sep 13, 2024

Is there a particular maintainer we should ping

It's just me, and I've been too busy to look into these recently. There's multiple debugger related complaints open right now and it's quite likely they're all related under the hood, but unfortunately that also means that it's possibly a multi-day day job to unravel what's going on.

I might be able to look at it this weekend, but obviously I can't promise anything.

@NathanNgo
Copy link

Hi @DaelonSuzuka, I appreciate the response and I'm grateful for the time you spend maintaining this codebase!

While it would be awesome to have the debugger working again, please don't feel any pressure to do so if you don't have the time!

@DaelonSuzuka
Copy link
Collaborator

Good news, it doesn't die when decoding typed arrays now.

image

It's gonna take... a lot of work to carry that information through to VSCode's debugger interface, but this should at least keep the debugger from blowing up.

@Calinou I'm gonna get this fix plus a couple others cleaned up and merged, can you publish a hotfix later today maybe?

@DevAndrewGeorge
Copy link

Any chance on getting that hotfix deployed?

@DaelonSuzuka
Copy link
Collaborator

v2.2.0 was published today and should be available in the marketplace now. Please make sure your extension updates and let me know if you're still experiencing this behavior.

@umutseven92
Copy link

@DaelonSuzuka The problem seems to still occur on 2.2.0, with the same error:

2024-09-25 01:04:02.214 [error] RangeError: The value of "offset" is out of range. It must be >= 0 and <= 192. Received 196
	at boundsError (node:internal/buffer:88:9)
	at Buffer.readUInt32LE (node:internal/buffer:222:5)
	at Qc.decode_UInt32 (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:42447)
	at Qc.decode_variant (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:38878)
	at Qc.decode_Array (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:41515)
	at Qc.decode_variant (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:40403)
	at Qc.decode_Array (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:41515)
	at Qc.decode_variant (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:40403)
	at Qc.decode_Array (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:41515)
	at Qc.decode_variant (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:40403)
	at Qc.get_dataset (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:41165)
	at Zc.on_data (/Users/umutseven/.vscode/extensions/geequlim.godot-tools-2.2.0/out/extension.js:214:51883)
	at Socket.emit (node:events:519:28)
	at addChunk (node:internal/streams/readable:559:12)
	at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
	at Readable.push (node:internal/streams/readable:390:5)
	at TCP.onStreamRead (node:internal/stream_base_commons:191:23

@DaelonSuzuka
Copy link
Collaborator

@umutseven92 I can't reproduce it on my end, can you share the variable declaration that's causing the failure?

@mihe
Copy link
Contributor

mihe commented Oct 8, 2024

I believe I tracked down the remaining issue with typed arrays. I put up a PR for it here: #731.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants