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

Oracle's Exadata (GNU/Linux-powered) and VirtualBox 5.2 Beta

  • Oracle Brings Bare Metal Exadata Performance to the Cloud
    Oracle's Exadata Cloud Service price list for non-metered services currently starts at a list price of $55,000 a month. For that price, organizations get the Oracle Database Exadata Cloud Service with a quarter-rack bare-metal Exadata X6 system.
  • Oracle Outs Second VirtualBox 5.2 Beta to Support Red Hat Enterprise Linux 7.4
    Oracle's Director of Product Management Simon Coter was pleased to announce on Wednesday the release and immediate availability for download of the second VirtualBox 5.2 Beta. VirtualBox 5.2 is currently under heavy development, and a first Beta release was published a week ago, giving users a glimpse at the major new features coming to the open-source and cross-platform virtualization software from Oracle. Focusing on improvements and regression fixes for the first Beta, VirtualBox 5.2 Beta 2 is here today to introduce support for the recently released Red Hat Enterprise Linux 7.4 operating system in the Linux Additions component.

The future of Python and when not to use a regex

  • The future of Python: Concurrency devoured, Node.js next on menu
    The PyBay 2017 conference, held in San Francisco over the weekend, began with a keynote about concurrency. Though hardly a draw for a general interest audience, the topic – an examination of multithreaded and multiprocess programming techniques – turns out to be central to the future of Python. Since 2008, the Python community has tried to reconcile incompatibility between Python 2 and newly introduced Python 3. For years, adoption of Python 3 was slow and some even dared to suggest Python didn't have a future. As late as last year, Zed Shaw, an accomplished developer and author of the popular Learn Python the Hard Way, even ventured to opine, "There is a high probability that Python 3 is such a failure it will kill Python." Despite these unsubstantiated odds, Shaw – a polarizing figure for some Pythonistas – this year released a version of his book for Python 3.
  • When not to use a regex
     

    A regex is useful for validating simple patterns and for finding patterns in text. For anything beyond that it’s almost certainly a terrible choice.

Linux: Cloud Foundry, HMM, AMD Radeon and NVIDIA

  • Navigating Cloud Foundry
    This open source platform-as-a-service cloud platform bridges the gap between legacy applications and cloud services. For all the talk about the cloud, many applications continue to run on traditional servers. Hybrid architectures are sometimes the right option, but if you want to move corporate applications onto the Internet, you don’t want to start from scratch. Cloud Foundry, a platform-as-a-service (PaaS) cloud platform, enables enterprises to move older software to the cloud and build new cloud-centric programs using familiar tools and programming languages.
  • HMM Revised Its 25th Time, Seeking Inclusion In Linux 4.14
    Jerome Glisse of Red Hat has published his 25th revision to the Heterogeneous Memory Management (HMM) patch series. HMM is about allowing a process address space to be mirrored and for system memory to be transparently used by any device process. With HMM v25, there are more code comments and documentations, fixes to the code, merging the HMM-CDM patches into this patch series, and other improvements.
  • Radeon X.Org Driver Gets Fixed Up To Always Allow Page-Flipping With TearFree
    It's fairly rare these days seeing improvements to the xf86-video-ati DDX: the driver for those running a pre-AMDGPU (GCN 1.2) graphics card with this driver paired with Radeon DRM and not using the generic xf86-video-modesetting driver instead. But if you are using xf86-video-ati and use the "TearFree" feature to try to avoid screen tearing, a number of patches landed today. Michel Dänzer of AMD landed a handful of patches to the xf86-video-ati Git repository today for the Radeon DDX. Notably the patches make for always allowing DRI2 page-flipping to be used with TearFree and the same goes for DRI Present page-flipping with the TearFree option. Long story short, page-flipping should now always work in the TearFree mode.
  • NVIDIA Releases Vulkan 381.26.13 Beta Linux Driver
    NVIDIA's driver team has today released new Vulkan beta drivers for both Windows and Linux. The new NVIDIA Linux Vulkan beta is versioned at 381.26.13, so still not yet re-based to the current 384 series, but these changes should end up being merged for their next feature series to mainline.

Krita 3.2.0 Released

  • Krita 3.2.0 Released
    Later than planned, here’s Krita 3.2.0! With the new G’Mic-qt plugin integration, the smart patch tool, finger painting on touch screens, new brush presets and a lot of bug fixes. Read the full release notes for more information!. Here’s GDQuest’s video introducing 3.2.0:
  • Krita 3.2 Released For Leading Open-Source Digital Painting
    The Krita project has today announced version 3.2 is ready of their open-source, cross-platform digital painting program. Krita 3.2 features new G'Mic-qt plugin integration, a smart patch tool, finger painting on touch screens, new brush presets, a variety of fixes, and other minor improvements.