在配置KGDB时,必须通过串口才能调试一台测试Linux, 如果通过本机是Linux的话, 就可以使用应用直接链接上VMware的linux,进行通讯.
1 2 3 4 5 6 7 8 9 |
|
在配置KGDB时,必须通过串口才能调试一台测试Linux, 如果通过本机是Linux的话, 就可以使用应用直接链接上VMware的linux,进行通讯.
1 2 3 4 5 6 7 8 9 |
|
Host机:一个装有Ubuntu12.04-x86-64的主机
Target机:运行在vmware上的 Ubuntu12.04-server-x86-64 的Linux.
内核编译选项CONFIG_DEBUG_RODATA,会对kernel text做write protect。 那么kgdb就不能设置断点了。
编辑kernel source目录下生成的.config文件, 禁用CONFIG_DEBUG_RODATA=n (read only data)重新编译即可
http://www.mail-archive.com/kgdb-bugreport@lists.sourceforge.net/msg03464.html
Hi Folks,
I’m wondering if anyone has had issues with setting breakpoints. I’m
able to break into the kernel, access data, do a backtrace, etc, but
when I attempt to set a breakpoint, then continue, I get the following error:Cannot insert breakpoint 1.
Error accessing memory address 0xffffffff81310931: Unknown error 4294967295.I’m attaching a sample session, I had set remote debug to 1
Thanks!
Pat Thomson
Hi Thomson,
It seems that your problem is the CONFIG_DEBUG_RODATA option was
enabled, It is recommend to turn CONFIG_DEBUG_RODATA off when using kgdb.
From the kgdb document(DocBook/kgdb.tmpl):
If the architecture that you are using supports the kernel option
CONFIG_DEBUG_RODATA, you should consider turning it off. This
option will prevent the use of software breakpoints because it
marks certain regions of the kernel's memory space as read-only.
If kgdb supports it for the architecture you are using, you can
use hardware breakpoints if you desire to run with the
CONFIG_DEBUG_RODATA option turned on, else you need to turn off
this option.
Thanks, Dongdong