首页 > 数据库技术 > 详细

内核panic后使用GDB调试

时间:2015-04-20 18:33:56      阅读:406      评论:0      收藏:0      [点我收藏+]

内核运行时若出现panic,可以根据EIT的值用GDB来定位出错代码:
例如我的出错代码的EIT的值为0x80cf7c00+0x6f,可以在GDB下用b或l方式来定位代码。

yin123@yin:~/work/XXXXX$ gdb ./android/out/target/product/Your_Image_Name/obj/kernel/vmlinux
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
Copyright (C) 2012 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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/yin123/work/XXXXX/android/out/target/product/Your_Image_Name/obj/kernel/vmlinux...done.
(gdb) b *0x80cf7c6f
Breakpoint 1 at 0x80cf7c6f: file /home/yin123/work/XXXXX/linux-3.10/drivers/cpufreq/yyyyy.c, line 123.
(gdb) l *oc_thread+0x6f
0x80cf7c6f is in oc_thread (/home/yin123/work/XXXXX/linux-3.10/drivers/cpufreq/yyyyy.c:123).
warning: Source file is more recent than executable.
118     *(strchr(buf, ‘.‘)) = ‘\0‘;
119     sscanf(buf, "%u", &tmp_runtime);        
120 
121     /* get last recorded uptime */
122     get_data_from_sysfs(FILE_PATH, buf);
123     (strchr(buf, ‘ ‘)) = ‘\0‘;
124     sscanf(buf, "%u", &old_runtime);        
125 
126     if (tmp_runtime <= old_runtime)
127     {

内核panic后使用GDB调试

原文:http://blog.csdn.net/yin262/article/details/45152401

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!