[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: debugging LKMs with GDB
aq <aquynh@xxxxxxxxx> writes:
> On Mon, 8 Nov 2004 01:04:04 +0000, Jon Masters <jonmasters@xxxxxxxxx> wrote:
>> On Sun, 7 Nov 2004 21:51:11 +0530, Shakthi Kannan <shakthimaan@xxxxxxxxx> wrote:
>>
>> > On Sun, 7 Nov 2004 14:07:47 +0530, Himanshu Chauhan
>> > <meethimanshuchauhan@xxxxxxxxx> wrote:
>> > > As we can debug user space programs with GDB, how can we debug the
>> > > loadable kernel modules
>> > > with GDB.
>> >
>> > I believe it can be done. You can probably even use ddd (Data Display
>> > Debugger). But, you may have to pass /proc/kcore to gdb.
>>
>> You can, but not from the same box.
>>
>> As was mentioned by Ajey Kulkarni in an earlier post, kgdb should help
>> here - it's a patch to the kernel which allows remote debugging from a
>> second host, whereas kdb (without the g) is a built-in debugger that
>> won't give you quite the level of debug.
>>
>> Note that Linus does not bless kernel debuggers, but he has come
>> around to understanding a use for Dprobes. Perhaps it's worth using
>> probes as an alternative to a full debugger.
>
> You misspelled it. That should be "kprobes", not Dprobes
I thought the same thing, but then I thought, "No, Jon Masters would
probably not do that." A google later, I see...
http://www-124.ibm.com/developerworks/oss/linux/projects/dprobes/
which says...
DProbes basic infrastructural parts are split out as stand-alone
patches defining new interfaces called Kprobes.
--
Ed L Cashin <ecashin@xxxxxxxxxx>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/