[CrashHandler] Always print frame PCs and main module load address for retrace.

This commit is contained in:
Pāvels Nadtočajevs
2026-02-05 09:41:30 +02:00
parent babc272d44
commit c20e4dd010
4 changed files with 154 additions and 24 deletions
+4 -1
View File
@@ -104,6 +104,9 @@ static void handle_crash(int sig) {
// Non glibc systems apparently don't give PIE relocation info.
uintptr_t relocation = 0;
#endif //__GLIBC__
print_error(vformat("Load address: %x\n", (uint64_t)relocation));
if (strings) {
int ret;
@@ -170,7 +173,7 @@ static void handle_crash(int sig) {
}
// Simplify printed file paths to remove redundant `/./` sections (e.g. `/opt/godot/./core` -> `/opt/godot/core`).
print_error(vformat("[%d] %s (%s)", (int64_t)i, fname, err == OK ? addr2line_results[i].replace("/./", "/") : ""));
print_error(vformat("[%d] %x - %s (%s)", (int64_t)i, (uint64_t)bt_buffer[i], fname, err == OK ? addr2line_results[i].replace("/./", "/") : ""));
}
free(strings);