=================================
本文系本站原创,欢迎转载!
转载请注明出处:http://blog.csdn.net/gdt_a20
=================================
概要:看kernel代码的时候,变量多了,就记不清楚了,尤其是读内存部分代码的时候,传来传去,常常不知道
改成什么样子了,内存布局到底变成什么了,也许是我记忆力太不行了,利用qemu可以在线调试内核,如同你用gdb调试app一样,断点,打印变量值等等,qemu算是个模拟器吧,说虚拟机也可以,虽然bug很多,但是还不失为一个好工具,如果对qemu陌生,那android的模拟器相信大家都很熟悉了吧,那个也是基于开源的qemu修改的,好了让我们赶快开始调试的旅程吧.
一、环境
#$cat /etc/issue
Ubuntu 11.10 \n \l
二、gdb准备
#$$ gdb --version
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>.