Language Selection

English French German Italian Portuguese Spanish

Kernel Debugging Techniques

Filed under

Often the pivotal factor in achieving development timetables comes down to one's efficiency in finding and fixing bugs. Debugging inside the Linux kernel can be quite challenging. No matter how you approach it, kernel debugging will always be complex. This chapter examines some of the complexities and presents ideas and methods to improve your debugging skills inside the kernel and device drivers.

Debugging Optimized Kernel Code

At the start of this chapter, we said that one of the challenges identified in debugging kernel code results from compiler optimization. We noted that the Linux kernel is compiled by default with optimization level -O2. In the examples up to this point, we used -O1 optimization to simplify the debugging task. Here we illustrate one of the many ways optimization can complicate debugging.

The related Internet mail lists are strewn with questions related to what appear to be broken tools. Sometimes the poster reports that his debugger is singlestepping backward or that his line numbers do not line up with his source code. Here we present an example to illustrate the complexities that optimizing compilers bring to source-level debugging. In this example, the line numbers that gdb reports when a breakpoint is hit do not match up with the line numbers in our source file due to function inlining.

Full Story.

More in Tux Machines

Kubuntu 15.10 (Wily Werewolf) Now Has Latest KDE Plasma 5.4.2

Kubuntu 15.10 (Wily Werewolf) is almost ready for launch, but it looks like the developers are still pushing some important changes even this late in the cycle. Read more

Unicode 8.0 Support Added To GNOME's GLib

Within the latest development code of GNOME's key GLib library leading up to GNOME 3.20 is Unicode 8.0 support. Unicode 8.0 as released back in June adds 7,716 characters with six new scripts, many new symbols, and various character additions. Per this commit today by Red Hat's Matthias Clasen, GLib's Unicode support has been updated to version 8.0. Clasen wrote, "Regenerate data tables from the Unicode Character Database, add new scripts, and update tests to include some of the new data." Read more

Huawei Watch Review: Best Android Wear Smartwatch Available

The Huawei Watch currently offers the best option on the Android Wear platform. The Huawei Watch looks elegant and offers great design as well as multiple attractive style options depending on the buyer’s cash flow. Even iPhone owners can take a look. If an iPhone owner prefers a stainless steel round watch, then the Huawei Watch is a usable option at a lower price than the Stainless Steel Apple Watch. Android Wear works well on iPhone, but does not give users the same level of integration. The most important features work fine, including notifications and fitness tracking. We give the Huawei Watch a hearty recommendation. It is worth paying a little more for this attractive and well-designed Android Wear smartwatch. Read more

Linux Kernel 4.1.10 LTS Is Now Available for Download with Networking Fixes

After announcing the release of the Linux 4.2.3 kernel, Greg Kroah-Hartman has informed the world today, October 3, about the release and immediate availability for download of the tenth maintenance version of the Linux 4.1 LTS kernel series. Read more Also: Linux 4.3-rc4 Kernel Released: Adds A New & Better String Copy Function Linus Torvalds Announces Linux Kernel 4.3 RC4 on the Eve of the Project's 24th Birthday