set(CMAKE_BUILD_TYPE "Release") # "Release" or "Debug"
set(CHCORE_PLAT "raspi3")
set(CHCORE_ARCH "aarch64")
这里为了使得CMake支持调试应该将Release改成Debug。
产生的elf文件中,.text段含有调试信息。
`Disassembly of section .text:
ffffff000008c000 <start_kernel>:
* Code in bootloader specified only the primary
* cpu with MPIDR = 0 can be boot here. So we directly
* set the TPIDR_EL1 to 0, which represent the logical
* cpuid in the kernel
*/
mov x3, #0
ffffff000008c000: d2800003 mov x3, #0x0 // #0
msr TPIDR_EL1, x3
ffffff000008c004: d518d083 msr tpidr_el1, x3`
但是 .init不含有调试信息,不知道什么原因
`Disassembly of section init:
0000000000080000 <_start>:
80000: d53800a8 mrs x8, mpidr_el1
80004: 92401d08 and x8, x8, #0xff
80008: b4000048 cbz x8, 80010 <primary>
000000000008000c <secondary_hang>:
8000c: 94000000 bl 8000c <secondary_hang>
0000000000080010 <primary>:
80010: 94001bfc bl 87000 <arm64_elX_to_el1>
80014: 1003bee0 adr x0, 877f0 <boot_cpu_stack>
80018: 91400400 add x0, x0, #0x1, lsl #12
8001c: 9100001f mov sp, x0
80020: 94001cd1 bl 87364 <init_c>
80024: 14000000 b 80024 <primary+0x14>
80028: 14000007 b 80044 <__start_kernel_veneer+0x18>`