Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Jan 2009 15:21:17 +0700
From:      Eugene Grosbein <eugen@kuzbass.ru>
To:        Kamlesh Patel <shilp.kamal@yahoo.com>
Cc:        freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org
Subject:   Re: FreeBSD kernel Debugging tools for Virtual Memory Module
Message-ID:  <20090102082117.GA78125@svzserv.kemerovo.su>
In-Reply-To: <387210.21917.qm@web45407.mail.sp1.yahoo.com>
References:  <387210.21917.qm@web45407.mail.sp1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 01, 2009 at 06:27:44PM -0800, Kamlesh Patel wrote:

> I am working on Virtual Memory parts of FreeBSD OS. My Problem is, whenever i modify little code of vmpage.c file i need to build the whole kernel to check the modification and i even am not able to debug the kernel code.
> 
> Could anyone please inform me kernel Debugging tools for FreeBSD OS?

First, you need to recompile source you change for sure :-)
But you have not rebuild all other files all the time.
You need to add to your /etc/src.conf (or /etc/make.conf for 6.x and earlier):

MODULES_WITH_WORLD=yes

This will skip rebuilding of all modules during 'make buildkernel'
but you MUST to copy all modules from /boot/kernel to /boot/modules
(all files other than /boot/kernel/kernel*) if you do this.
Otherwise, you'll lose modules and system may not boot due to missing
vital modules like acpi.ko

Then, if you do not change kernel config file,
recompile your changes with command (only second time and then):

cd /usr/src; make NO_KERNELDEPEND=yes NO_KERNELCLEAN=yes buildkernel

So, your rebuild time changes drastically: no modules rebuild,
no other sources rebuild other that you touched last time.
It will relink previously compiled object code with your changes only,
that's way much quicker. Reinstall kernel and reboot.

Second, you should use some kind of virtual machine (like qemu from ports)
to speedup your development cycle even more: install the system
into virtual machine and you'll need not another box to debug the kernel
and need not rebuild your development box. Test your changes with the system
installed into VM and reboot it only. Use ddb or kgdb already noted here.

Eugene Grosbein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090102082117.GA78125>