溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Linux加載vmlinux調試的示例分析

發(fā)布時間:2021-07-14 13:40:14 來源:億速云 閱讀:196 作者:小新 欄目:服務器

這篇文章主要為大家展示了“Linux加載vmlinux調試的示例分析”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“Linux加載vmlinux調試的示例分析”這篇文章吧。

使用gdb加載內核符號表

arm-eabi-gdb out/target/product/msm8625/obj/KERNEL_OBJ/vmlinux

在內核的.config里面要打開 DEBUG_INFO和DEBUG_VM

定位故障代碼

(gdb) l * qrd7627a_add_io_devices+0x100
0xc07cd05c is in qrd7627a_add_io_devices (/home/yejialong/GH700C/kernel/arch/arm/mach-msm/msm8x25/goso-msm7627a-io.c:1851).
1846      } else if (machine_is_msm8625q_skud() || machine_is_msm8625q_evbd()) {
1847    #ifndef CONFIG_CALA02
1848          platform_device_register(&pmic_mpp_leds_pdev_skud);
1849    #endif
1850          /* enable the skud flash and torch by gpio leds driver */
1851          platform_device_register(&gpio_flash_skud);
1852      } else if (machine_is_msm8625q_skue()) {
1853           /* enable the skue flashlight by gpio leds driver */
1854          platform_device_register(&gpio_flash_skue);
1855      }

下面是mtk平臺加載的方法,但是不管哪個平臺都是差不多的,道理都是一樣的。

weiqifa@weiqifa-Inspiron-3847:~/weiqifa/tm100$ ./prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-gdb ./out/target/product/tm100/obj/KERNEL_OBJ/vmlinux
GNU gdb (GDB) 7.3.1-gg2
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-linux-android".
For bug reporting instructions, please see:
<http://source.android.com/source/report-bugs.html>...
Reading symbols from /home/weiqifa/weiqifa/tm100/out/target/product/tm100/obj/KERNEL_OBJ/vmlinux...done.
(gdb)

rockchip rk3399調試vmlinux

./prebuilts/gcc/linux-x86/aarch74/aarch74-linux-android-4.9/bin/aarch74-linux-android-addr2line -f -e kernel/vmlinux
weiqifa@dev:~/rk3399_7in1$ ./prebuilts/gcc/linux-x86/aarch74/aarch74-linux-android-4.9/bin/aarch74-linux-android-addr2line -f -e kernel/vmlinux ffffff8008459f3c
rk_iommu_domain_free
/data/weiqifa/rk3399_7in1/kernel/drivers/iommu/rockchip-iommu.c:1005 (discriminator 2)
weiqifa@dev:~/rk3399_7in1$

RK平臺tombstone調試

./prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-addr2line -e ./out/target/product/rk3399_mid/symbols/system/lib/libspeexresampler.so 0x00002d54
/proc/self/cwd/external/speex/libspeex/resample.c:376

arm-eabi-gdb  先用命令找到這個東西,然后在去找去找到vmlinux  還有就是我arm-eabi-4.7/ 這個版本才可以用,這個是我試出來的。

以上是“Linux加載vmlinux調試的示例分析”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業(yè)資訊頻道!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI