Conversation
|
@Calinou Is this still desired? If so, it needs to be rebased on the latest master branch. |
|
Needs rebasing. Should be fine to merge then if it works. |
9e2e275 to
cc4c4e2
Compare
|
Rebased and tested again on Linux, it works as expected. Please test this on macOS before merging. The Windows portion of this PR won't work correctly until #44118 is merged (which still needs testers on Windows 7/8.1). |
cc4c4e2 to
95d37cf
Compare
|
Since, #44118 is merged now, maybe we can get this merged after a rebase. |
|
Rebased and tested again, it works as expected on Linux and Windows (MSVC). See OP for updated screenshots. @bruvzg If you have time, could you test and review the macOS side of this just in case? Thanks in advance 🙂 |
95d37cf to
a27ed52
Compare
Should this be changed in another PR, either in the crash handler or the |
a27ed52 to
8b20d4a
Compare
|
Probably a crash handler should be changed to handle SIGTRAP. CRASH_NOW is calling |
|
Just noticed this, nice work! Is it really needed to explicitly add TTY checks and ANSI codes everywhere instead of having some sort of generic, optionally colored print system though? That might sound a bit excessive (and can definitely become such) but I'm pretty sure that there might be a clean and simple way of going along with it (hell, perhaps even a bunch of macros?). If it's done in more places that might be material for another PR but I can't stop wondering about this. |
|
8b20d4a to
95cbc6f
Compare
|
@Calinou Would you like to rebase this? I'm interested. |
95cbc6f to
b76d3e3
Compare
|
I'm interested in this PR. Will it be merged after 4.6 release or is it still undetermined when this PR may be merged? |
| // Dump the backtrace to stderr with a message to the user. | ||
| print_error("\n================================================================"); | ||
| print_error(vformat("%s: Program crashed with signal %d", __FUNCTION__, sig)); | ||
| if (isatty(fileno(stderr))) { |
There was a problem hiding this comment.
This can be changed to OS::get_singleton()->get_stderr_type() == OS::STD_HANDLE_CONSOLE and used on all platforms, including Windows.
b76d3e3 to
356d6f9
Compare
This makes them easier to read.
TODO: - Port to other crash handlers (including the other Linux crash handler below in that file).
|
Rebased and tested again, it works as expected. Putting this back to draft as I'm working on reorganizing colors based on recent changes to the various crash handlers. I'll also need to figure out a way to factor out as much code as possible to avoid duplication. Currently, it looks like this on Linux with the second commit and https://github.com/gimli-rs/addr2line installed:
Godot functions are highlighted (as we're usually interested in those in crash handlers), and function/parameter names are distinguished. |
356d6f9 to
0e588e7
Compare



Follow-up to #44118.
This makes crash backtraces easier to read, which in turn improves the developer experience.
Preview
Windows 10 (MSVC)
Linux
PS: For testing purposes, you can call
CRASH_NOW();anywhere to make Godot crash.