You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Targets.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -839,11 +839,12 @@ These flags apply to `polarfire_mpfs250_m_qspi.config` and are added via `CFLAGS
839
839
840
840
#### Stack overflow detection
841
841
842
-
The trap handler in `src/boot_riscv.c` automatically detects stack overflow on synchronous exceptions. When a trap fires with `SP < _main_hart_stack_bottom`, it prints:
842
+
The trap handler in `src/boot_riscv.c` automatically detects stack overflow on synchronous exceptions (requires `DEBUG_BOOT`). When a trap fires with `SP < _main_hart_stack_bottom`, it prints:
843
843
844
844
```
845
-
TRAP: cause=2 epc=A000740 tval=0 sp=A02FFE8
846
-
STACK OVERFLOW: sp=A02FFE8 < bottom=A030000 (under by 24)
845
+
TRAP: cause=2 epc=A000740 tval=0
846
+
sp=A02FFE8
847
+
STACK OVERFLOW: under by 24
847
848
```
848
849
849
850
This is helpful for diagnosing illegal-instruction TRAPs at random valid `.text` addresses, which are the classic signature of stack overflow corrupting the return address.
0 commit comments