Linux调试之(三)addr2line+vmlinux

文章目录

  • Linux调试之(三)addr2line+vmlinux
    • 【1】 addr2line位置
    • 【2】addr2line使用
        • [1] 说明是空指针造成的错误
        • [2] 寄存器信息主要是PC的值
        • [3] addr2line定位错误

Linux调试之(三)addr2line+vmlinux

addr2line可以将出错代码地址转转换成代码所在文件所在行。


【1】 addr2line位置

./prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-addr2line


【2】addr2line使用

分析崩溃重启log:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 805 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.14.0 #11
task: ee8a0000 ti: ee8a4000 task.ti: ee8a4000
PC is at dm9000_probe+0x1c/0x8f0
LR is at platform_drv_probe+0x18/0x48
pc : [<c0277cc8>]    lr : [<c0247f7c>]    psr: 60000153
sp : ee8a5e48  ip : 00000000  fp : 00000000
r10: c052a4fc  r9 : 00000000  r8 : c0591e98
r7 : 00000000  r6 : ee97c810  r5 : ee97c800  r4 : 00000000
r3 : 000000ff  r2 : 00000000  r1 : ee8a5de8  r0 : ee97c800
Flags: nZCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 4000404a  DAC: 00000015
Process swapper/0 (pid: 1, stack limit = 0xee8a4240)
Stack: (0xee8a5e48 to 0xee8a6000)
5e40:               ee975cf0 00000000 ee1503a8 00000001 c0561afc ee150438
5e60: 00000000 ee97c810 c0591e98 ee97c810 00000000 c0591e98 c0561afc c052a4fc
5e80: 00000000 c0247f7c c0247f64 c05d931c c0591e98 c0246668 ee97c810 c0591e98
[<c0277cc8>] (dm9000_probe) from [<c0247f7c>] (platform_drv_probe+0x18/0x48)
[<c0247f7c>] (platform_drv_probe) from [<c0246668>] (driver_probe_device+0x100/0x210)
[<c0246668>] (driver_probe_device) from [<c0246804>] (__driver_attach+0x8c/0x90)
[<c0246804>] (__driver_attach) from [<c0244fbc>] (bus_for_each_dev+0x58/0x88)
[<c0244fbc>] (bus_for_each_dev) from [<c0245e28>] (bus_add_driver+0xd8/0x1cc)
[<c0245e28>] (bus_add_driver) from [<c0246e1c>] (driver_register+0x78/0xf4)

[1] 说明是空指针造成的错误

Unable to handle kernel NULL pointer dereference at virtual address 00000000

[2] 寄存器信息主要是PC的值

PC is at dm9000_probe+0x1c/0x8f0
pc : []    lr : []    psr: 60000153

[3] addr2line定位错误

aarch64-linux-android-addr2line -f -e vmlinux 0xyyyyyyyy也就是PC值)

./prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-
  android-addr2line -f -e kernel/vmlinux c0277cc8 dm9000_probe

你可能感兴趣的:(Linux调试之(三)addr2line+vmlinux)