mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-23 12:15:32 +08:00
[libcpu][component][debug] add debug info for gdb (#7033)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023 RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-03-12 WangXiaoyao the first version
|
||||
*/
|
||||
#ifndef __ASM_GENERIC_H__
|
||||
#define __ASM_GENERIC_H__
|
||||
|
||||
#define START_POINT(funcname) \
|
||||
.type funcname, %function; \
|
||||
.global funcname; \
|
||||
funcname: \
|
||||
.cfi_sections .debug_frame, .eh_frame; \
|
||||
.cfi_startproc; \
|
||||
.cfi_undefined lr
|
||||
|
||||
#define START_POINT_END(name) \
|
||||
.cfi_endproc; \
|
||||
.size name, .-name;
|
||||
|
||||
#endif /* __ASM_GENERIC_H__ */
|
||||
@@ -97,4 +97,6 @@ rt_inline void rt_hw_dsb(void)
|
||||
__asm volatile ("dsb":::"memory");
|
||||
}
|
||||
|
||||
void _thread_start(void);
|
||||
|
||||
#endif /*CPUPORT_H__*/
|
||||
|
||||
@@ -35,7 +35,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
|
||||
stack_addr += sizeof(rt_uint32_t);
|
||||
stack_addr = (rt_uint8_t *)RT_ALIGN_DOWN((rt_uint32_t)stack_addr, 8);
|
||||
stk = (rt_uint32_t *)stack_addr;
|
||||
*(--stk) = (rt_uint32_t)tentry; /* entry point */
|
||||
*(--stk) = (rt_uint32_t)_thread_start; /* entry point */
|
||||
*(--stk) = (rt_uint32_t)texit; /* lr */
|
||||
*(--stk) = 0xdeadbeef; /* r12 */
|
||||
*(--stk) = 0xdeadbeef; /* r11 */
|
||||
@@ -48,8 +48,8 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
|
||||
*(--stk) = 0xdeadbeef; /* r4 */
|
||||
*(--stk) = 0xdeadbeef; /* r3 */
|
||||
*(--stk) = 0xdeadbeef; /* r2 */
|
||||
*(--stk) = 0xdeadbeef; /* r1 */
|
||||
*(--stk) = (rt_uint32_t)parameter; /* r0 : argument */
|
||||
*(--stk) = (rt_uint32_t)tentry; /* r1 : argument 2 for trampoline */
|
||||
*(--stk) = (rt_uint32_t)parameter; /* r0 : argument 1 */
|
||||
/* cpsr */
|
||||
if ((rt_uint32_t)tentry & 0x01)
|
||||
*(--stk) = SVCMODE | 0x20; /* thumb mode */
|
||||
|
||||
@@ -673,6 +673,15 @@ rt_hw_clz:
|
||||
#define RT_CPUS_NR 1
|
||||
#endif
|
||||
|
||||
#include "asm-generic.h"
|
||||
|
||||
START_POINT(_thread_start)
|
||||
mov r10, lr
|
||||
blx r1
|
||||
blx r10
|
||||
b . /* never here */
|
||||
START_POINT_END(_thread_start)
|
||||
|
||||
.bss
|
||||
.align 3 /* align to 2~3=8 */
|
||||
svc_stack_n:
|
||||
|
||||
Reference in New Issue
Block a user