English 中文(简体)
Gnu Debugger & Franklin Kernel
原标题:Gnu Debugger & Linux Kernel

I have compiled my own Kernel module and now I would like to be able to load it into the GNU Debugger GDB. I did this once, a year ago or so to have a look at the memory layout. It worked fine then, but of course I was too silly to write down the single steps I took to accomplish this... Can anyone enlighten me or point me to a good tutorial?

非常感谢

问题回答

For kernels > 2.6.26 (i.e. after May 2008), the preferred way is probably to use "kgdb light" (not to be confused with its ancestor kgdb, available as a set of kernel patches). "kgdb light" is now part of the kernel (in by default in current Ubuntu kernels, for instance), and it s capabilities are improving fast (Jason Wessel is working on it - possible google key).

Drawback: You need two machines, the one you re debugging and the development machine (host) where gdb runs. Currently, those two machines can only be linked through a serial link. kgdb runs in the target machine where it handles the breakpoints, stepping, etc. and the remote debugging protocol use to talk with the development machine. gdb runs in the development machine where it handles the user interface. An USB-to-serial adapter works OK on the development machine, but currently, you need a real UART on the target machine - and that s not so frequent anymore on recent hardware.

The (terse) kgdb documentation is in the kernel sources, in Documentation/DocBook

I suggest you google around for "kgdb light" for the complete story. Again, don t confuse kgdb and kgdb light, they come together in google searches but are mostly different animals. In particular, info from linsyssoft.com relate to the "ancestor" kgdb, so try queries like:

kgdb module debugging -"linsyssoft.com" -site:linsyssoft.com

and discard articles prior to May 2008 / 2.6.26 kernel. Finally, for module debugging, you need to manually load the module symbols in the dev machine for all the code and sections you are interested in. That s a bit too long to address here, but some clues there, there and there. Bottom line is, kgdb is a very welcome improvement but don t expect this trip to be as easy as running gdb in user mode. Yet. :)

由于我正在积极发展对六氯环己烷的驱动力,因此我的答复可能只是过时的。 我要说的是,你不能使用亚洲开发银行。 如果有的话,只能对垃圾堆放档案中的验尸。 ug倒你们应当使用一个掩体。 能够用一个挖土机铺设掩体(在我积极工作时没有的箱子为2.6个。) 我使用了Sun ftp://oss.sgi.com/www/projects/kdb/download/为KDB提供的油轮机,我对此感到非常高兴。 用户空间工具获得大量使用,除非有新的电 g与内部电梯间断裂(你必须启动任何途径)进行某种交流。

我希望这至少给你一些方面,但并不是一个详细的答复。 答案根本不是答案。 在这方面。

我怀疑你所做的工作。

gdb /boot/vmlinux /proc/kcore

当然,你实际上可以做任何偷盗行为,但肯定是好的,可以把烟.上.。





相关问题
Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Asp.Net MVC - Problem returning a model to the view

I ve recently started using the Areas functionality of the Preview2 and it was working ok until I needed to return a Model to the view. Controller: public ActionResult ForgotPassword() { return ...

Unable to generate PDB files in Visual Studio 2005

For most assemblies, I m able to generate their respective .pdb files. However, I ve got one project that isn t generating their .pdb files. I ve made sure that it on debug mode and that the project ...

热门标签