diff --git a/cpu/native/include/architecture_arch.h b/cpu/native/include/architecture_arch.h index ef3ebf2fa5..1a9f7ae06d 100644 --- a/cpu/native/include/architecture_arch.h +++ b/cpu/native/include/architecture_arch.h @@ -24,9 +24,17 @@ extern "C" { #endif +/** + * @brief raise SIGTRAP + * + * We must not include signal.h directly into RIOT application namespace. + */ +void native_breakpoint(void); + /* Doc is provided centrally in architecture.h, hide this from Doxygen */ #ifndef DOXYGEN #define ARCHITECTURE_WORD_BITS (32U) +#define ARCHITECTURE_BREAKPOINT(v) native_breakpoint() #endif /* DOXYGEN */ #ifdef __cplusplus diff --git a/cpu/native/native_cpu.c b/cpu/native/native_cpu.c index 7e0cf5aaa5..5e9e96875a 100644 --- a/cpu/native/native_cpu.c +++ b/cpu/native/native_cpu.c @@ -99,6 +99,11 @@ int thread_isr_stack_usage(void) return -1; } +void native_breakpoint(void) +{ + raise(SIGTRAP); +} + static inline void *align_stack(uintptr_t start, int *stacksize) { const size_t alignment = sizeof(uintptr_t);