-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Log when debugger drops large variables. #74148
base: master
Are you sure you want to change the base?
Conversation
I don't think we should make this spammy, the inspector should instead print something like |
Perfect, thanks for the reference. I was trying to find an existing type to reflect an error like that. I'll take a look at setting that up tomorrow. |
Thanks for looking into this @baptr ! I was the one seeing this behavior yesterday and agree that showing something directly in the debugger would be the best option. @Faless do you think it's reasonable to add an editor/project setting to be able to change this 1MB limit? It seems very easy to reach :) i am happy to look into it if so. |
With the new debugger code in 4.0, could larger variables be handled out of the box? It may be a good opportunity to raise the limit to 4 MB or even 8 MB. |
It's confusing to see `<null>` objects in the debugger inspector when they should be assigned, and hard to track down why it might be. It turns out the remote debugger's DebuggerMarshalls serialize functions default to transferring at most 1MiB of data. Before this, it would silently drop anything that would be too large. - Stop recursively encoding objects when checking their size, since they're not actually sent that way. - Change PROPERTY_HINT_OBJECT_TOO_BIG to a more generic PROPERTY_HINT_ENCODING_ERROR and use hint_string to specify the issue. - Plumb ENCODING_ERROR hints (but no others) through the remote debugger. - Surface the new ENCODING_ERROR hint_string in the debugger.
I hacked around with it a bit... It turns out the 1MiB check is a bit bogus anyway, since the
vs godot/core/debugger/remote_debugger_peer.cpp Line 108 in 1d14c05
Changing that gives a lot more headroom for the more common cases, but you can still trip the limit with large flat variants like a huge array. So I pushed a bit more on giving some feedback when there is an encoding problem... Unfortunately I didn't find a great way to surface property hints for conveying them. The existing But that only helps for the debugger's stack view, not the remote scene tree. We'd need a different solution for Arrays (and probably other custom rendered types) that keep their type information in the remote scene tree, which render as Here's what my current sketch in 5f19775 produces if I omit the first encode_variant tweak to trigger more |
Here's the same as a draft PR with split commits, if that's useful: #74230 |
I'm confused, is this still waiting for reviewers or is there another issue? |
It's confusing to see
<null>
objects in the debugger stack inspector when they should be assigned, and hard to track down why it might be.It turns out the remote debugger's DebuggerMarshalls serialize functions default to transferring at most 1MiB of data. Before this, it would silently drop anything that would be too large, and display them as
<null>
Before:
(no logs of any sort)
After:
(same stack view), but:
Related: #39465
Possibly related: #38965, #36801