Use KDB debugging tools

Source: Internet
Author: User

KDB is an official version of the Linux kernel code. Therefore, you cannot use the Linux kernel version that comes with ubuntu. You need to download it from the official website.

1. Download The kdbpatch corresponding to the internal code pair from ftp://oss.sgi.com/www/projects/kdb/download,

For example, Linux 2.6.18133, You need to download the kdb-v4.4-2.6.18-common-1.bz2 and kdb-v4.4-2.6.18-i386-1.bz files.

2. After the price is downloaded, store it in the/usr/src directory and decompress the package using Bzip2:

$sudo bzip2 -d kdb-v4.4-2.6.18-common-1.bz2$sudo bzip2 -d kdb-v4.4-2.6.18-i386-1.bz

3. Enter the/usr/src/Linux Directory, which stores kernel code 2.6.18. Patch the kernel code using the patch tool:

$ patch -p1 < ../kdb-v4.4-2.6.18-common-1.bz2$ patch -p1< ../kdb-v4.4-2.6.18-i386-1.bz

If no error is prompted, the operation is successful.

4. Compile the kernel

Update the Ubuntu kernel compilation package:

$sudo apt-get install kernel-package$sudo apt-get install libncurses5-dev$sudo apt-get install fakeroot$sudo apt-get install wget

Then use make oldconfig to import the Kernel configuration to the previous version. After the configuration is imported, use make menuconfig to enter the Kernel configuration interface, go to the kernel hacking menu, open built-in kernel debugger support, then open the KDB off by default and KDB modules options, save and exit.

Next, compile and install the kernel:

$sudo make$sudo make modules_install$sudo make install

After installation, a kernel boot menu of version 2.6.18 is added to the grub boot menu.

Restart the machine and choose to start from kernel 2.6.18.

Open KDB through the/proc file system after startup:

$sudo echo "1" > /proc/sys/kernel/kdb

If no prompt is displayed after you press enter, KDB is successfully enabled.

Press the pause/Break Key To Go To The KDB debugging interface.

When you exit the interface, enter go and press Enter.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.