diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-27 15:27:52 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-29 21:46:26 -0700 |
commit | 9eaa70ddf2e5c50503b5e135b52b39ac7ae6f089 (patch) | |
tree | e6b29ee637d8f8eab54939fcd932af6bcce6beb1 /libcr/coroutine.c | |
parent | 5d1c30d11f2f8f1dcf2c1d823a1b0c174dc53495 (diff) |
gdb-helpers/libcr.py: Use fewer breakpoints
They're at a premium on the RP2040.
Diffstat (limited to 'libcr/coroutine.c')
-rw-r--r-- | libcr/coroutine.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libcr/coroutine.c b/libcr/coroutine.c index 18b2b80..a4d41e8 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -42,6 +42,9 @@ #ifndef CONFIG_COROUTINE_VALGRIND #error config.h must define CONFIG_COROUTINE_VALGRIND (bool) #endif +#ifndef CONFIG_COROUTINE_GDB + #error config.h must define CONFIG_COROUTINE_GDB (bool) +#endif /* Implementation *************************************************************/ @@ -127,6 +130,7 @@ */ #define ALWAYS_INLINE [[gnu::always_inline]] inline +#define NEVER_INLINE [[gnu::noinline]] /* platform support ***********************************************************/ @@ -314,7 +318,14 @@ uintptr_t sp; #endif } cr_plat_jmp_buf; - static inline void _cr_plat_setjmp_pre(cr_plat_jmp_buf *env [[gnu::unused]]) { + #if CONIG_COROUTINE_GDB + NEVER_INLINE + #endif + static void _cr_plat_setjmp_pre(cr_plat_jmp_buf *env [[gnu::unused]]) { + #if CONIG_COROUTINE_GDB + /* Prevent the call from being optimized away. */ + asm (""); + #endif #if CONFIG_COROUTINE_MEASURE_STACK env->sp = cr_plat_get_sp(); #endif |