feat: add crash stack snapshots and context menu annotations

This commit is contained in:
2026-08-12 18:30:08 +02:00
parent 3ef98a9fd5
commit 7f2d4b693f
8 changed files with 71 additions and 1 deletions
+30
View File
@@ -212,6 +212,28 @@ static void render() {
y += SECTION_GAP;
}
if (g_report.stackWordCount != 0) {
section_header(c, y, w, fh, "Stack Snapshot");
for (int i = 0; i < g_report.stackWordCount && i < 8; i++) {
char label[24] = "Stack + 0x00";
static const char digits[] = "0123456789ABCDEF";
unsigned offset = (unsigned)i * 8;
label[10] = digits[(offset >> 4) & 0xF];
label[11] = digits[offset & 0xF];
if (i == 0) {
label[12] = ' ';
label[13] = '(';
label[14] = 'r';
label[15] = 'e';
label[16] = 't';
label[17] = ')';
label[18] = '\0';
}
format_hex16(hexbuf, g_report.stackWords[i]);
table_row(c, y, row_h, COL1_W, w, rowIdx++, label, hexbuf, VALUE_COL);
}
}
g_win.present();
}
@@ -248,6 +270,14 @@ static void render_console() {
emit_kv_hex("RFLAGS", g_report.flags);
if (g_report.exceptionVector == 0x0E)
emit_kv_hex("CR2 (fault addr)", g_report.faultingAddress);
for (int i = 0; i < g_report.stackWordCount && i < 8; i++) {
char key[] = "Stack + 0x00";
static const char digits[] = "0123456789ABCDEF";
unsigned offset = (unsigned)i * 8;
key[10] = digits[(offset >> 4) & 0xF];
key[11] = digits[offset & 0xF];
emit_kv_hex(key, g_report.stackWords[i]);
}
emit("\n");
}