objdump 参数介绍
- -d: 将代码段反汇编
- -S: 将代码段反汇编的同时,将反汇编代码和源代码交替显示,源码编译时需要加-g参数,即需要调试信息
- -C: 将C++符号名逆向解析
- -l: 反汇编代码中插入源代码的文件名和行号
- -j section: 仅反编译所指定的section,可以有多个-j参数来选择多个section
具体用法示例如下:
>>objdump -dS helloworld.ko > helloworld.s
//需要注意,编译时需加-g参数,在Makefile EXTRA_CFLAS中添加
>>vim hellowrold.s |
Oops信息介绍
Oct 10 09:20:15 localhost kernel: [ 305.701709] BUG: unable to handle kernel NULL pointer dereference at (null)
#Bug的原因 Oct 10 09:20:15 localhost kernel: [ 305.702491] IP: [] Funciton_ERROR + 0x96 / 0x96 [cm] #Bug的函数 红色表示函数偏移(出错位置) 黄色表示函数大小 Oct 10 09:20:15 localhost kernel: [ 305.702606] PGD 0 Oct 10 09:20:15 localhost kernel: [ 305.702678] Oops: 0000 [#1] SMP Oct 10 09:20:15 localhost kernel: [ 305.702789] Modules linked in: xx1(O) xx2(O) xx3(O) xx4(O) scst_vdisk(O) scst(O) dlm configfs sctp libcrc32c xx5(O) htel ghash_clmulni_intel shpchp vmxnet3 i2c_piix4 pcspkr microcode vmw_balloon aesni_intel ablk_helper cryptd lrw aes_x86_64 xts gf128mul vmw_pvscsi floppy vm Oct 10 09:20:15 localhost kernel: [ 305.705168] CPU 3 Oct 10 09:20:15 localhost kernel: [ 305.705254] Pid: 1598, comm: CmJob0 Tainted: G O 3.8.0 #4 VMware, Inc. VMware Virtual Platform/440BX Desktop R Oct 10 09:20:15 localhost kernel: [ 305.705550] RIP: 0010:[ffffffffa0479cf8] [ffffffffa0479cf8] Function_ERROR+0x96/0x1bf [xx1] Oct 10 09:20:15 localhost kernel: [ 305.705887] RSP: 0018:ffff88040259fd88 EFLAGS: 00010246 Oct 10 09:20:15 localhost kernel: [ 305.706045] RAX: ffff8804299ab000 RBX: ffff88042417c148 RCX: 0000000000000002 Oct 10 09:20:15 localhost kernel: [ 305.706247] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88042417c000 Oct 10 09:20:15 localhost kernel: [ 305.706449] RBP: ffff88040259fde8 R08: 0000000000000000 R09: 0000000000000004 Oct 10 09:20:15 localhost kernel: [ 305.706634] R10: 0000000000000000 R11: ffff88040259fde8 R12: ffff880424180000 Oct 10 09:20:15 localhost kernel: [ 305.706819] R13: 0000000000000000 R14: ffff88040289c000 R15: 0000000000001000 Oct 10 09:20:15 localhost kernel: [ 305.707029] FS: 0000000000000000(0000) GS:ffff88043fcc0000(0000) knlGS:0000000000000000 Oct 10 09:20:15 localhost kernel: [ 305.707282] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b Oct 10 09:20:15 localhost kernel: [ 305.707461] CR2: 0000000000000000 CR3: 000000042aa2c000 CR4: 00000000000407e0 Oct 10 09:20:15 localhost kernel: [ 305.707701] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 Oct 10 09:20:15 localhost kernel: [ 305.707947] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Oct 10 09:20:15 localhost kernel: [ 305.708058] Process CmJob0 (pid: 1598, threadinfo ffff88040259e000, task ffff88042bbac1d0) Oct 10 09:20:15 localhost kernel: [ 305.708197] Stack: Oct 10 09:20:15 localhost kernel: [ 305.708261] ffff880424180000 ffff88042417c000 ffff88040259fde8 0000000000000000 Oct 10 09:20:15 localhost kernel: [ 305.708500] 0000000000000004 ffff8804299ab000 ffffffffa0483b28 ffff88042417c000 Oct 10 09:20:15 localhost kernel: [ 305.708739] ffff880425178000 ffff880424180000 ffff88042417c178 ffffffffa0483044 Oct 10 09:20:15 localhost kernel: [ 305.708978] Call Trace: #函数调用栈 Oct 10 09:20:15 localhost kernel: [ 305.709052] [] Function_4+0x283/0x43d [xx1] Oct 10 09:20:15 localhost kernel: [ 305.709165] [] Function_3+0x244/0x2a2 [xx1] Oct 10 09:20:15 localhost kernel: [ 305.709271] [] Function_2+0x1e5/0x278 [xx1] Oct 10 09:20:15 localhost kernel: [ 305.709375] [] ? Function_1+0xf3/0xf3 [xx1] Oct 10 09:20:15 localhost kernel: [ 305.709487] [] kthread+0x95/0x9d Oct 10 09:20:15 localhost kernel: [ 305.709579] [] ? kthread_freezable_should_stop +0x46/0x46 Oct 10 09:20:15 localhost kernel: [ 305.709690] [] ret_from_fork+0x7c/0xb0 Oct 10 09:20:15 localhost kernel: [ 305.709785] [] ? kthread_freezable_should_stop + 0x46/0x46 |