$ qemu -S -kernel bzImage -hda linux-0.2.img -append "root=/dev/hda"
beyes@debian:~/kernel$ gdb vmlinux
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu"...
(gdb)
beyes@debian:~/kernel$ gdb vmlinux
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu"...
(gdb) b start_kernel
Breakpoint 1 at 0xc13f05a6: file init/main.c, line 517.
(gdb) target remote localhost:1234 /*使用 gdbserver 进行调试命令*/
Remote debugging using localhost:1234
[New Thread 1]
0x0000fff0 in ?? ()
(gdb) c
Continuing.
Breakpoint 1, start_kernel () at init/main.c:517
517 smp_setup_processor_id();
(gdb)
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |