Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19766: core/lib: make the use of DEBUG_BREAKPOINT on assert optional r=gschorcht a=gschorcht ### Contribution description This PR makes the use of `DEBUG_BREAKPOINT` on failed assertion optional. The behavior of `assert` has been changed with PR #19368. Instead of printing some useful information, either a breakpoint is inserted and the execution of the MCU stops in debugger or a endless while loop is executed. Before PR #19368 the user got on failed assertion: ``` Starting ESP32x with ID: 7cdfa1e36a34 ESP-IDF SDK Version v4.4.1-0-g1329b19fe49 ... *** RIOT kernel panic: FAILED ASSERTION. *** halted. ``` This was very helpful during development, especially to identify quickly the cause of problems with `DEBUG_ASSERT_VERBOSE` enabled, e.g. when misconfiguration led to failed assertions. With PR #19368 the user gets an address in best case (or even `0` on platforms like ESP32), in worst case the MCU seems to stuck, e.g. ``` Starting ESP32x with ID: 7cdfa1e36a34 ESP-IDF SDK Version v4.4.1-0-g1329b19fe49 ... 0 ``` The problem with the new behavior is that - a user doesn't get a quick indication of what happened - there is not always an easy way to attach a debugger This PR therefore makes the use of `DEBUG_BREAKPOINT` optional using `DEBUG_ASSERT_BREAKPOINT` define. ### Testing procedure Add `assert(0)` in `examples/hello-world/main.c` and compile with and w/o `CFLAGS='-DDEBUG_ASSERT_BREAKPOINT'`. With `DEBUG_ASSERT_BREAKPOINT` the execution should stop in `assert_failue`. Without `DEBUG_ASSERT_BREAKPOINT`, the information as generated before PR #19368 and the execution should stop in `panic_arch`. ### Issues/PRs references Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
- Loading branch information