Language Selection

English French German Italian Portuguese Spanish

Kernel Debugging Techniques

Filed under
HowTos

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

[The founder of Linux Malta] Ramon Casha, chairman of the humanist association, passes away

Tributes are flowing in this evening for Ramon Casha, chairman of the Malta Humanist Society, civil rights campaigner and a frequent commenter on Times of Malta, who has passed away. Michael Briguglio, former chairman of Alternattiva wrote in a Facebook post: Rest in peace Ramon Casha: honest, free-thinking and non-partisan civil society campaigner within Malta Humanist Association and so many causes. Read more

KDE Leftovers

  • Qt Creator 4.2.1 released
    We are happy to announce the release of Qt Creator 4.2.1. This is a pure bugfix release, and takes care of various important bugs.
  • KTextEditor depends on KSyntaxHighlighting
    Recently, the KSyntaxHighlighting framework was added to the KDE Frameworks 5.29 release. And starting with KDE Frameworks 5.29, KTextEditor depends on KSyntaxHighlighting. This also means that KTextEditor now queries KSyntaxHighlighting for available xml highlighting files.
  • [Krita] Interview with Adam
    Good day. My name is Adam and I am a 26-year-old person who is trying to learn how to draw…
  • [Krita] We’re doing a User Survey!
    While we’re still working on Vector, Text and Python Scripting, we’ve already decided: This year, we want to spend on stabilizing and polishing Krita!

More of today's howtos

Linux and Graphics