qemu 调试 kernel (二)
来源:互联网 发布:朝鲜 中国 关系 知乎 编辑:程序博客网 时间:2024/06/06 12:48
qemu搭建调试环境见前面,现在已经将裸kernel起来,马上进行debug:
1. 在qemu界面,用ctrl+alt+1 或 ctrl+alt+2, 切换到qemu输出与控制页面
2. 在qemu控制页面下,输入: gdbserver 1234;(这里我总是提示 could not open device on device '1234', 输入gdbserver tcp::1234就ok了!)
3. 回到shell,gdb vmlinux
提示:
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/linux-code/linux-stable-3.8.3/vmlinux...done.
(gdb)
4. target remote 127.0.0.1:1234
显示:
Remote debugging using 127.0.0.1:1234
0x0000fff0 in ?? ()
5. 简单的一个测试:
(gdb) b start_kernel
Breakpoint 1 at 0xc164662b: file init/main.c, line 469.
(gdb) i b
Num Type Disp Enb Address What
1 breakpoint keep y 0xc164662b in start_kernel at init/main.c:469
(gdb) b idle_init
Breakpoint 2 at 0xc1658f0d: file kernel/smpboot.c, line 50.
(gdb) i b
Num Type Disp Enb Address What
1 breakpoint keep y 0xc164662b in start_kernel at init/main.c:469
2 breakpoint keep y 0xc1658f0d in idle_threads_init
at kernel/smpboot.c:50
(gdb) c
Continuing.
Breakpoint 1, start_kernel () at init/main.c:469
469 {
(gdb) c
Continuing.
Breakpoint 2, idle_threads_init () at kernel/smpboot.c:72
72 idle_init(cpu);
(gdb) bt
#0 idle_threads_init () at kernel/smpboot.c:72
#1 0xc1659e95 in smp_init () at kernel/smp.c:665
#2 0xc16469b5 in kernel_init_freeable () at init/main.c:874
#3 0xc1464a0b in kernel_init (unused=<optimized out>) at init/main.c:809
#4 0xc147d7f7 in ret_from_kernel_thread () at arch/x86/kernel/entry_32.S:311
#5 0xc1464a00 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
初始化的过程: start_kernel => 起thread: rest_init
----> kernel_init => smp_init => idle_threads_init()为每个cpu创建idle thread;
- qemu 调试 kernel (二)
- qemu调试 linux-kernel
- 用QEMU+GDB 调试LINUX KERNEL
- ubuntu12.04 下 利用 qemu kgdb 调试kernel
- 搭建基于qemu + eclipse的kernel调试环境(by quqi99)
- debug kernel with qemu
- Qemu compatible kernel configuration
- qemu kernel debug
- qemu下运行kernel
- 用qemu与gdb调试linux kernel tcp/ip协议栈
- gdb qemu调试linux kernel并修改远程连接的bug
- 用Qemu模拟vexpress-a9 (一) --- 搭建Linux kernel调试环境
- 结合Yocto Qemu与Eclipse单步调试开发Linux Kernel
- qemu linux kernel & vmware linux kernel
- Debug Linux Kernel with Qemu
- Qemu+Gdb debug linux kernel
- qemu搭建kernel学习环境
- qemu & arm debug uboot kernel
- spring多数据源配置
- 03 Android Gallery 和 ImageView 的组合使用
- C++拷贝构造函数(深拷贝,浅拷贝)参考一
- 解决Bootstrap模态对话框嵌套的一个bug
- hdoj 1078 FatMouse and Cheese(记忆化搜索)
- qemu 调试 kernel (二)
- 关于怎样提权的小帖子
- jquery实现ajax联动框 二
- 解决linux ping: unknown host www.baidu.com
- Weka学习 Apriori算法if( !m_car)
- C++拷贝构造函数(深拷贝,浅拷贝)参考二
- Revit 2014 API新功能网络视频讲座 5月14号下午14:30(可下载讲座视频)
- Objectvie-C XML解析
- UVA 10305 Ordering Tasks