elpekenin/crash.h

Utilities to check why (if) last execution crashed.


bool program_crashed(void)
[source]

Check if program crashed on previous execution.

backtrace_t *get_crash_call_stack(uint8_t *depth)
[source]

Get the information about last execution.

Parameters:
  • depth – Pointer to your variable, will be set to how deep the backtrace is.

Returns:

Call stack that crashed the program (NULL if didn’t crash)

void set_crash_info(const char *msg)
[source]

Store the information that next run will read.

Parameters:
  • msg – A text that will be stored along backtrace.

void clear_crash_info(void)
[source]

Clear the structure that holds crash information. So that we dont mistakenly think, on next iteration, that current one crashed, because it was left there.

void print_crash_call_stack(void)
[source]

Tiny utility to print the information about last crash.