From 5ff7ec5a40d8bf69532d6b854160159f11c63a29 Mon Sep 17 00:00:00 2001 From: shaojinchun Date: Thu, 3 Jun 2021 15:41:10 +0800 Subject: [PATCH] gdbserver add attach support --- components/lwp/arch/arm/cortex-a/lwp_gcc.S | 7 ++++++- include/rtdef.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/lwp/arch/arm/cortex-a/lwp_gcc.S b/components/lwp/arch/arm/cortex-a/lwp_gcc.S index 45eeea3933..433946bcd9 100644 --- a/components/lwp/arch/arm/cortex-a/lwp_gcc.S +++ b/components/lwp/arch/arm/cortex-a/lwp_gcc.S @@ -183,7 +183,12 @@ ret_to_user: cmp r0, #0 pop {r0-r3, r12, lr} bne user_do_signal - +#ifdef RT_USING_GDBSERVER + push {r0-r3, r12, lr} + mov r0, lr + bl lwp_check_debug_attach_req + pop {r0-r3, r12, lr} +#endif movs pc, lr #ifdef RT_USING_LWP diff --git a/include/rtdef.h b/include/rtdef.h index a479349c62..5bd59cbf2f 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -744,10 +744,13 @@ struct rt_thread struct rt_wakeup wakeup; /**< wakeup data */ int exit_request; #ifdef RT_USING_USERSPACE +#ifdef RT_USING_GDBSERVER int step_exec; + int debug_attach_req; int debug_ret_user; int debug_suspend; struct rt_hw_exp_stack *regs; +#endif void * thread_idr; /** lwp thread indicator */ int *clear_child_tid; #endif -- Gitee