kdb
[Top] [All Lists]

Re: debugging a module

To: kdb@xxxxxxxxxxx
Subject: Re: debugging a module
From: Marc Esipovich <marc@xxxxxxxxx>
Date: Mon, 4 Sep 2000 22:55:16 +0300
Sender: owner-kdb@xxxxxxxxxxx
Hi,

>   I have some problems with a module I am developing on linux 2.2.12 .
> Now I want to set some breakpoints and debug the program. I have used kdb
> on the kernel. But I don't know how can I use kdb to debug a module added 
> using insmod. 

You use kdb on a kernel module exactly the same way you would use it on the
live kernel, when the module is loaded, you can use kdb to break on
any function in your module which has its symbol exported.

You can also put an 'int 3' instruction exactly where you need to break,
use something like the following macro:

#define DEBUGBREAK       __asm__ __volatile__ ("int3");

 bye,
        Marc.

--
marc @ corky.net

fingerprint = D1F0 5689 967F B87A 98EB  C64D 256A D6BF 80DE 6D3C

          /"\
          \ /     ASCII Ribbon Campaign
           X      Against HTML Mail
          / \

<Prev in Thread] Current Thread [Next in Thread>