From 34aef9cbecaa8df829640a0d268ae4e508af8577 Mon Sep 17 00:00:00 2001 From: yangao1 Date: Tue, 20 May 2025 14:42:29 +0800 Subject: [PATCH] armv7a:add cfi instrcutions to debug (gdb) bt #0 memset () at machine/arm/armv7-a/gnu/arch_memset.S:45 #1 0x0407222e in memset (n=4, c=65, s=0x40269d94) at /home/mi/ssd/dev-system/nuttx/include/string.h:203 #2 test_memset () at hello_main.c:57 #3 hello_main (argc=, argv=) at hello_main.c:66 #4 0x0403f1de in nxtask_startup (entrypt=0x40721b1 , argc=1, argv=0x40269628) at sched/task_startup.c:72 #5 0x0400c66a in nxtask_start () at task/task_start.c:104 #6 0x00000000 in ?? () Signed-off-by: yangao1 --- libs/libc/machine/arm/armv7-a/arch_memcpy.S | 3 +++ libs/libc/machine/arm/armv7-a/arch_memmove.S | 3 +++ libs/libc/machine/arm/armv7-a/arch_memset.S | 3 +++ 3 files changed, 9 insertions(+) diff --git a/libs/libc/machine/arm/armv7-a/arch_memcpy.S b/libs/libc/machine/arm/armv7-a/arch_memcpy.S index 11fed34538f..ea41f403cc3 100644 --- a/libs/libc/machine/arm/armv7-a/arch_memcpy.S +++ b/libs/libc/machine/arm/armv7-a/arch_memcpy.S @@ -164,6 +164,8 @@ .endm def_fn ARCH_LIBCFUN(memcpy) p2align=6 + .cfi_sections .debug_frame + .cfi_startproc mov dst, dstin /* Preserve dstin, we need to return it. */ cmp count, #64 @@ -627,6 +629,7 @@ def_fn ARCH_LIBCFUN(memcpy) p2align=6 bne .Ltail63unaligned bx lr + .cfi_endproc .size ARCH_LIBCFUN(memcpy), . - ARCH_LIBCFUN(memcpy) #endif diff --git a/libs/libc/machine/arm/armv7-a/arch_memmove.S b/libs/libc/machine/arm/armv7-a/arch_memmove.S index 094b963e111..60b2cc4b9d0 100644 --- a/libs/libc/machine/arm/armv7-a/arch_memmove.S +++ b/libs/libc/machine/arm/armv7-a/arch_memmove.S @@ -38,6 +38,8 @@ .global ARCH_LIBCFUN(memmove) .type ARCH_LIBCFUN(memmove), %function ARCH_LIBCFUN(memmove): + .cfi_sections .debug_frame + .cfi_startproc cmp r0, r1 push {r4} bls 3f @@ -67,6 +69,7 @@ ARCH_LIBCFUN(memmove): bne 4b pop {r4} bx lr + .cfi_endproc .size ARCH_LIBCFUN(memmove), . - ARCH_LIBCFUN(memmove) #endif diff --git a/libs/libc/machine/arm/armv7-a/arch_memset.S b/libs/libc/machine/arm/armv7-a/arch_memset.S index b7fe6ebeb1f..5f2e551d3a3 100644 --- a/libs/libc/machine/arm/armv7-a/arch_memset.S +++ b/libs/libc/machine/arm/armv7-a/arch_memset.S @@ -38,6 +38,8 @@ .global ARCH_LIBCFUN(memset) .type ARCH_LIBCFUN(memset), %function ARCH_LIBCFUN(memset): + .cfi_sections .debug_frame + .cfi_startproc #ifdef __ARM_NEON__ mov r3, r0 @@ -219,5 +221,6 @@ ARCH_LIBCFUN(memset): ldmfd sp!, {r0, r4-r7, pc} #endif + .cfi_endproc #endif