-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
push_error/warning should print GDScript line, not C++ #76770
Labels
Milestone
Comments
TV4Fun
added a commit
to TV4Fun/godot
that referenced
this issue
Jun 27, 2024
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. Fixes godotengine#76770
TV4Fun
added a commit
to TV4Fun/godot
that referenced
this issue
Jul 3, 2024
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. Fixes godotengine#76770
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: