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

GNOME's Evolution Email Client Now Follows the Notification Settings of GNOME Shell

The GNOME developers are still working hard these days on the second milestone of the upcoming GNOME 3.20 desktop environment, which means that we should see more and more updates to various core components and GNOME applications. Read more Also: GNOME Shell and Mutter Updated for GNOME 3.20, Several Bugs Were Fixed

My Open Source Thanksgiving List: Wine, Netflix, OpenWrt and More

Running 3.1 miles through my hometown. Consuming unreasonable quantities of simple carbohydrates, fat and sodium. Pretending that the former activity justifies the latter. These are some of my favorite Thanksgiving traditions. Read more

BlackArch Linux ISO Images Updated with Over 100 New Tools, Multilib Support

The developers of the Arch Linux-based BlackArch GNU/Linux operating system have announced today, November 25, 2015, the immediate availability for download of a new installation media for the distribution. Read more

Snapcraft 0.5 Is Out for Snappy Ubuntu 15.04, Snapcraft 2.0 In Plan for Ubuntu 16.04

Canonical's Sergio Schvezov informs all users of the Snappy Ubuntu Core operating system for embedded and IoT (Internet of Things) devices about the release of the Snapcraft 0.5 snaps creation utility. Read more