编译驱动带上-g参数如下
ccflags-y += -g
反汇编驱动
aarch64-v01c01-linux-gnu-objdump -S -d ot_rgn.ko > rgn.txt
000000000000e3c0 <rgn_batch_end>:
e3c0: d503233f paciasp
e3c4: d10283ff sub sp, sp, #0xa0
…
…
e6a4: 94000000 bl 0 <osal_wait_wakeup>
e6a8: b9406260 ldr w0, [x19, #96]
e6ac: 34000200 cbz w0, e6ec <rgn_batch_end+0x32c>
错误堆栈
osal_wait_wakeup+0x28/0x5c [ot_osal]
rgn_batch_end+0x2e8/0x520 [ot_rgn]
rgn_batch_end+0x4d8/0x520 [ot_rgn]
venc_put_osd+0xc0/0x15c [ot_venc]
计算地址
000000000000e3c0(函数入口地址)+0x2e8(堆栈报错偏移地址)=000000000000e6a8
根据地址获取行号
aarch64-v01c01-linux-gnu-addr2line -e ot_rgn.ko 000000000000e6a8
结果:/mkp/src/region_get_put_region.c:289