debugging kernel code..

Pranav Peshwe pranavpeshwe at
Fri Feb 17 16:54:27 PST 2006

On 2/18/06, divyesh shah <divs_83 at> wrote:
> I have added a system call and a somple program which
> uses that call. However, I need to debug my system
> call code. gdb doesn't help as it doesnt allow me to
> step into kernel level code from my user test program.
> Is there any way I can write debug information(say
> like printf statements)? I have seen some kernel code
> using printf's but I wonder where would they be
> printed out. Is there some kind of kernel log file??
          You can use printfs in your module.You will be able to see
whatever you have printfed on the console,also it is logged in the
ASCII text file - /var/log/messages. You can use uprintf if you do not
want to log the messages in the file but want to see them on
console.You can configure DDB and remote GDB (using a serial line) for
debugging kernel code/modules.



"There is no such thing as a foe. There is no such thing in existence as
a friend.
It is force of circumstances that creates friends and foes."
			- The Mahabharata

More information about the freebsd-questions mailing list