mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Add a "-- CUT HERE --" marker to exception output (#7369)
Users aren't reporting/seeing the actual PC of failures because they are only copying the >>stack<< into the decoder and not the Exception line. Add an ALL CAPS "CUT HERE FOR EXCEPTION DECODER" line to the output to make it blindingly obvious to include the full crashdump both in bug reports as well as exception decodes.
This commit is contained in:
parent
fe673cc16a
commit
a70e834d1e
@ -92,6 +92,18 @@ static void ets_printf_P(const char *str, ...) {
|
||||
}
|
||||
}
|
||||
|
||||
static void cut_here() {
|
||||
ets_putc('\n');
|
||||
for (auto i = 0; i < 15; i++ ) {
|
||||
ets_putc('-');
|
||||
}
|
||||
ets_printf_P(PSTR(" CUT HERE FOR EXCEPTION DECODER "));
|
||||
for (auto i = 0; i < 15; i++ ) {
|
||||
ets_putc('-');
|
||||
}
|
||||
ets_putc('\n');
|
||||
}
|
||||
|
||||
void __wrap_system_restart_local() {
|
||||
register uint32_t sp asm("a1");
|
||||
uint32_t sp_dump = sp;
|
||||
@ -113,6 +125,8 @@ void __wrap_system_restart_local() {
|
||||
|
||||
ets_install_putc1(&uart_write_char_d);
|
||||
|
||||
cut_here();
|
||||
|
||||
if (s_panic_line) {
|
||||
ets_printf_P(PSTR("\nPanic %S:%d %S"), s_panic_file, s_panic_line, s_panic_func);
|
||||
if (s_panic_what) {
|
||||
@ -193,6 +207,8 @@ void __wrap_system_restart_local() {
|
||||
#endif
|
||||
}
|
||||
|
||||
cut_here();
|
||||
|
||||
custom_crash_callback( &rst_info, sp_dump + offset, stack_end );
|
||||
|
||||
ets_delay_us(10000);
|
||||
|
@ -113,6 +113,10 @@ out in which line of application it is triggered. Please refer to `Check
|
||||
Where the Code Crashes <#check-where-the-code-crashes>`__ point below
|
||||
for a quick example how to do it.
|
||||
|
||||
**NOTE:** When decoding exceptions be sure to include all lines between
|
||||
the ``---- CUT HERE ----`` marks in the output to allow the decoder to also
|
||||
provide the line of code that's actually causing the exception.
|
||||
|
||||
Watchdog
|
||||
^^^^^^^^
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user