1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/native: define ARCHITECTURE_BREAKPOINT()

This commit is contained in:
Benjamin Valentin 2023-03-09 13:51:03 +01:00 committed by Benjamin Valentin
parent e850dcd921
commit fe4cc9169d
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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);