mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
1786fc9ed2
This commit refactors backtracing within the panic handler so that a common function esp_backtrace_get_next_frame() is used iteratively to traverse a callstack. A esp_backtrace_print() function has also be added that allows the printing of a backtrace at runtime. The esp_backtrace_print() function allows unity to print the backtrace of failed test cases and jump back to the main test menu without the need reset the chip. esp_backtrace_print() can also be used as a debugging function by users.
15 lines
435 B
C
15 lines
435 B
C
#include_next <setjmp.h>
|
|
#include "esp_panic.h"
|
|
|
|
/*
|
|
* This is the middle layer of setjmp to be used with the unity.
|
|
*/
|
|
|
|
/** Insert backtrace before longjmp (TEST_ABORT).
|
|
*
|
|
* Currently we only do long jump before test is ignored or failed.
|
|
* If this is also called when test pass, we may need to add some check before
|
|
* backtrace is called.
|
|
*/
|
|
#define longjmp(buf, val) do {esp_backtrace_print(100); longjmp(buf, val);} while(0)
|