码迷,mamicode.com
首页 > 数据库 > 详细

内核panic后使用GDB调试

时间:2015-04-20 18:36:16      阅读:197      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!