X86-X64 Windows 11 通过 挥码枪 连接 幽兰 Arm Ubuntu 23 Linux | Nano Debugger (NDB) debug Linux Kernel 5.x | 6.x by SDCardInterface2SerialPortConverter using JTAG

同时使用串口与挥码枪调试幽兰 - Powered by MinDoc

使用挥码枪调试网络操作 - Powered by MinDoc

2 加载内核符号及源代码

设置符号及源代码路径

在上位机上下载符号文件和源代码并记住相应路径
下载符号文件:https://share.weiyun.com/cX4iGDRO


下载源代码:https://share.weiyun.com/HmBC4FSk

C:\Users\Desktop\ulan\source\kernel\Makefile

# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 10
SUBLEVEL = 110
EXTRAVERSION =
NAME = Dare mighty things

注意Ulan有SSD盘NVME和eMMC闪存卡上两个Ubuntu Linux系统5.10.110和6.1.115:https://www.cnblogs.com/rgqancy/p/19847942

注意:一定要启动nvme上的Ubuntu Linux系统5.10.110。NanoCode才能正常加载源代码。

 

在nano code中设置路径

Starting new session...
Nano Debugger (NDB) 3.2025.955L (8504:1556)
Starting KD session type=usb,proto=ocd,opt=rxsbu,targetname=yl
debug_level: 3
GDDBG cmd NTP-DAP drivers NTP-DAP

0x140000
Using CMSIS-DAPv2 interface with VID:PID=0x0d28:0x1588, serial=202403307684abcdde6dbc1c2000410fa5a5a5a547454455
clock speed 12000 kHz
SWD DPIDR 0x2ba01477
cpu0: hardware has 6 breakpoints, 4 watchpoints
cpu1: hardware has 6 breakpoints, 4 watchpoints
cpu2: hardware has 6 breakpoints, 4 watchpoints
cpu3: hardware has 6 breakpoints, 4 watchpoints
cpu4: hardware has 6 breakpoints, 4 watchpoints
cpu5: hardware has 6 breakpoints, 4 watchpoints
cpu6: hardware has 6 breakpoints, 4 watchpoints
cpu7: hardware has 6 breakpoints, 4 watchpoints
NDB Embassy Version 3.2.0022.9
NDB session started in 8504:1860(0x2138:0x744)
Applying  last time used  symbol path: C:/Users/rgqan/Desktop/guoqiang/ulan/symbols;.
Symbol search path is: C:/Users/rgqan/Desktop/guoqiang/ulan/symbols
Applying  last time used  source path: C:\Users\rgqan\Desktop\guoqiang\ulan\source\kernel.
Applying  last time used  image path: .
cpu0 cluster 0 core 0 multi core
cpu1 cluster 1 core 0 multi core
cpu2 cluster 2 core 0 multi core
cpu3 cluster 3 core 0 multi core
cpu4 cluster 4 core 0 multi core
cpu5 cluster 5 core 0 multi core
cpu6 cluster 6 core 0 multi core
cpu7 cluster 7 core 0 multi core
CPU1's MIDR is updated to 0x412fd050
CPU2's MIDR is updated to 0x412fd050
CPU3's MIDR is updated to 0x412fd050
CPU4's MIDR is updated to 0x414fd0b0
CPU5's MIDR is updated to 0x414fd0b0
CPU6's MIDR is updated to 0x414fd0b0
CPU7's MIDR is updated to 0x414fd0b0
CPU0's MIDR is updated to 0x412fd050
OS meta is connected
Try heuristic algorithm now.
Found Linux image header at FFFFFFC010010000. D503233FD503201F size a9bc7bfd
detected _stext at 1000 with inst d10543ff
Target: machine aa64, kernel base 0xffffffc010011000, dbgdata 0x0, modhead 0x0 orig 0x0, printk buffer 0x0 length 0x0
The UTS information is not available now (000001D662510BE0)
Connected to Linux 11.0 ARMv8 64-bit, 64bit
Symbol search path is: C:/Users/rgqan/Desktop/guoqiang/ulan/symbols
Kernel symbol is loaded. Updating kernel layout now.
It may take minutes. Please wait...
read build id from target failed 1852795239 1680154682.
Linux Kernel Version 0 SMP (8 procs) free ARMv8 64-bit
Kernel base = 0xffffffc0`10011000 kernel module list = 0x00000000`00000000
System uptime: not available
lk!kernel_headers_data+2d2ec:
ffffffc011564dcc d50323bf autiasp	
l+t
Source options are 1:
     1/t - Step/trace by source line
1: kd>
0% 0%

k
Frame Base        Return Address    Call Site
ffffffc0`13e33e80 ffffffc0`11564e58 lk!vectors+0x200 [arch/arm64/kernel/entry.S @ 662]
ffffffc0`13e33e90 ffffffc0`10fe5e34 lk!kernel_headers_data+0x2d378
ffffffc0`13e33f10 ffffffc0`10fe6088 lk!led_trigger_set+0x1fc [drivers/leds/led-triggers.c @ 215]
ffffffc0`13e33f50 ffffffc0`100e1f88 lk!led_trigger_unregister+0x50 [drivers/leds/led-triggers.c @ 333]
ffffffc0`13e34040 ffffffc0`100e2220 lk!active_load_balance_cpu_stop+0x380 [kernel/sched/fair.c @ 10207]
ffffffc0`13e33ff0 ffffffc0`1002a9b4 lk!detach_entity_cfs_rq+0x210 [./include/asm-generic/bitops/non-atomic.h @ 106]
ffffffc0`13e34010 00000000`00000000 lk!el0_svc_common+0xffffffff`fe4f8394 [./arch/arm64/include/asm/syscall.h @ 58]
1: kd>

bp[522] was removed by ntp, total 0 instances
lk!el1_irq+ac:
ffffffc0100123ec d503201f nop	

注意:.srcpath 每次重新启动Nano Code后会丢失(默认为null),需要重新设置,否则Nano Code无法自动打开关联的源代码(汇编或者C语言)

.sympath C:/Users/rgqan/Desktop/guoqiang/ulan/symbols

.sympath
Symbol search path is: C:/Users/rgqan/Desktop/guoqiang/ulan/symbols

--------------------------------------------------------------------------

.srcpath
Source search path is null

.srcpath C:/Users/rgqan/Desktop/guoqiang/ulan/source/kernel
Source search path: C:/Users/rgqan/Desktop/guoqiang/ulan/source/kernel

 

[禁止RCU看门狗 - Powered by MinDoc](https://www.nanocode.cn/wiki/docs/youlan/rcudog)

在内核调试时,如果将内核中断下来停止太久,可能激活内核看门狗机制,引发内核崩溃,影响调试。

!ndx.dog off
Searching ndx in \\?\C:\NanoCode\exts;\\?\C:\NanoCode;C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Meld\;C:\Program Files\Go\bin;C:\Program Files\dotnet\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\nodejs16_6\;C:\Program Files\Notepad++\;C:\Program Files\Git\cmd;C:\Program Files\Vagrant\bin;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files\Rust stable MSVC 1.85\bin;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\app\rgqan\product\23ai\dbhomeFree\bin;C:\Users\rgqan\AppData\Local\Microsoft\WindowsApps\;C:\jdk-17.0.14\bin\;C:\apache-maven-3.9.9\\bin\;C:\gradle-7.5\bin;C:\Users\rgqan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\;C:\Users\rgqan\AppData\Roaming\npm\node_modules\yarn\bin\;C:\Program Files (x86)\NetSarang\Xshell 8\;C:\Program Files (x86)\NetSarang\Xftp 8\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Docker\Docker\resources\bin;C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Meld\;C:\Program Files\Go\bin;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files\Notepad++\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Rust stable MSVC 1.85\bin;C:\Program Files\Vagrant\bin;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Users\rgqan\AppData\Local\Microsoft\WindowsApps\;C:\Users\rgqan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra;C:\Users\rgqan\AppData\Local\Programs\Microsoft VS Code\bin;C:\app\rgqan\product\23ai\dbhomeFree\bin;C:\Users\rgqan\AppData\Roaming\npm;C:\NanoCode\bin;C:\Users\rgqan\.eide\bin\builder;C:\Users\rgqan\.eide\bin\builder\utils;.;C:\Users\rgqan\.eide\tools;C:\Users\rgqan\.eide\bin\builder\msys\bin
 [ndb]!ndx.dog off
invalid command name "ndx.dog"
!ndx.dog off
Searching ndx in \\?\C:\NanoCode\exts;\\?\C:\NanoCode;C:\Program Files\coreutils\bin;C:\Windows;C:\Windows\system32;C:\W

如果上述命令报错

那么可以用如下方法手动禁止:

x lk!rcu_cpu_stall_suppress
ffffffc0`12ab9eac  lk!rcu_cpu_stall_suppress 


dd ffffffc0`12ab9ea L1
0ffffffc`012ab9ea  ????????

ed ffffffc0`12ab9ea 1
Opcode 0xb8004401, DSCR.ERR=1, DSCR.EL=2 ed

 

posted @ 2026-06-29 20:01  rgqancy  阅读(6)  评论(0)    收藏  举报