Crash report: the log names what the crashing thread was building, and a library link names its case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tobim6
2026-11-12 16:22:24 +01:00
parent 7118dd426d
commit bb654470b2
5 changed files with 17 additions and 4 deletions

View File

@@ -1294,6 +1294,7 @@ void plat_mem_access_hook(int (*fn)(uint64_t addr, int write, uint64_t ip)) {
void plat_crash_context(const char *s) { (void)s; } // the Windows crash notes only
int plat_crash_filter_reassert(char *who, size_t n) { (void)who, (void)n; return 0; } // Windows only
const char *plat_crash_context_get(void) { return NULL; }
// plat_jmp_save / plat_jmp_go (platform.h): leaf code that does not move rsp before it leaves, as on Windows.
_Static_assert(sizeof(PlatJmp) == 72 && __builtin_offsetof(PlatJmp, mxcsr) == 64, "plat_jmp_save layout");

View File

@@ -296,6 +296,7 @@ void plat_crash_context(const char *s);
// Puts the crash hook's last-chance exception filter back in place. 1 when a DLL loaded later had set its own in its
// place (who: that filter's module and offset), 0 when it was still there. Windows only; 0 elsewhere.
int plat_crash_filter_reassert(char *who, size_t n);
const char *plat_crash_context_get(void); // the calling thread's note, for the crash report (NULL: none)
int plat_mem_read(uint64_t addr, void *out, size_t n); // copies n bytes, 0 instead of faulting on unmapped memory
int plat_mem_readable(uint64_t addr, uint64_t n); // every page of [addr, addr + n) can be read; no fault
void *plat_aligned_alloc(size_t size, size_t align); // free with plat_aligned_free; NULL on failure

View File

@@ -908,6 +908,7 @@ static void (*crash_fn)(const PlatCrash *c);
static const char *image_name(const char *base);
static __thread const char *crash_ctx;
void plat_crash_context(const char *s) { crash_ctx = s; }
const char *plat_crash_context_get(void) { return crash_ctx; }
static void raw_note(const char *tag, DWORD code, uintptr_t rip, uintptr_t addr) {
char b[256];
void *base = NULL;