You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These functions should print the GDScript line number, not some random C++ line number. The first is useful for a gdscript developer. The second two are not.
print_debug()
unlock not found in Controls.INPUT_ACTIONS
At: res://src/ui/hud/Commands.gd:23:_ready()
push_warning()
WARNING: unlock not found in Controls.INPUT_ACTIONS
at: push_warning (core/variant/variant_utility.cpp:922)
push_error()
ERROR: unlock not found in Controls.INPUT_ACTIONS
at: push_error (core/variant/variant_utility.cpp:902)
Currently, `push_error` and `push_warning` give themselve as the calling
function, which is not useful for debugging. I have altered these to use the
C stacktrace to get the name of the function that called them. This saves
having to turn these functions into macros, which would require recompiling
every single piece of code that uses them. I have also set it to, when debug
symbols are available, use them with `atos` (available on macOS) to find the
exact source file and line being called from. It should be possible to the same
thing on Linux using `addr2line`, but I don't have a Linux box handy to test
that. I am not sure how you would implement this in Windows.
I have tested this on macOS Sonoma 14.5 (23F79). It should work on any *nix
system. I am not sure about Windows.
Fixesgodotengine#76770
Currently, `push_error` and `push_warning` give themselve as the calling
function, which is not useful for debugging. I have altered these to use the
C stacktrace to get the name of the function that called them. This saves
having to turn these functions into macros, which would require recompiling
every single piece of code that uses them. I have also set it to, when debug
symbols are available, use them with `atos` (available on macOS) to find the
exact source file and line being called from. It should be possible to the same
thing on Linux using `addr2line`, but I don't have a Linux box handy to test
that. I am not sure how you would implement this in Windows.
I have tested this on macOS Sonoma 14.5 (23F79). It should work on any *nix
system. I am not sure about Windows.
Fixesgodotengine#76770
Godot version
4.0.2
System information
Windows 11/64, RTX 3070, Vulkan
Issue description
These functions should print the GDScript line number, not some random C++ line number. The first is useful for a gdscript developer. The second two are not.
print_debug()
push_warning()
push_error()
Related to godotengine/godot-proposals#1378, godotengine/godot-proposals#919
Steps to reproduce
See above
Minimal reproduction project
n/a
The text was updated successfully, but these errors were encountered: