From 150a10e8841f012645b77d1a6eb10d25dbf89b56 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sun, 8 Dec 2024 18:08:27 -0700 Subject: GDB fixes --- libcr/coroutine.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libcr/coroutine.c') diff --git a/libcr/coroutine.c b/libcr/coroutine.c index a947ae9..7392b6c 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -635,6 +635,12 @@ void coroutine_main(void) { assert(saved); assert(!cr_is_in_intrhandler()); coroutine_running = 0; +#if CONFIG_COROUTINE_GDB + /* Some pointless call to prevent cr_gdb_readjmp() from + * getting pruned out of the firmware image. */ + if (coroutine_table[0].state != CR_NONE) + cr_gdb_readjmp(&coroutine_table[0].env); +#endif while (coroutine_cnt) { cid_t next; while ( !((next = coroutine_ringbuf_pop())) ) { -- cgit v1.2.3-2-g168b