0%

Book Description

No matter how you approach it, Linux debugging will always be complex. The first part of this Short Cut examines some of these complexities as they relate to kernel debugging and present ideas and methods to improve your debugging skills, inside the kernel itself and then inside device drivers. You begin by learning to use Kernel GNU Debugger (KGDB) to probe the kernel. But because you cannot debug very early kernel startup code with KGDB, we also show you how to work with a hardware debug probe. For the examples in this section, we use a unit manufactured by Abatron called the BDI-2000. Hardware debug probes are often called JTAG probes, because they use a low-level communications method first employed for boundary scan testing of integrated circuits defined by the Joint Test Action Group (JTAG).

            In the second part of this Short Cut, we continue our coverage of GDB for debugging application code in user space. We extend our coverage of remote debugging and the tools and techniques used for this peculiar debugging environment.

This Short Cut includes Chapters 14 and 15 from the book Embedded Linux Primer by Christopher Hallinan (0-13-167984-8). As such, it contains references to earlier and later chapters that are not included in this Short Cut. Apart from these references, the Short Cut is fully self-contained and is an excellent choice for embedded Linux developers interested in learning both kernel-level and application-level debugging techniques.

Kernel Debugging Techniques

14.1    Challenges to Kernel Debugging    4

14.2    Using KGDB for Kernel Debugging    6     

14.3    Debugging the Linux Kernel    14 

14.4    Hardward-Assisted Debugging    53

14.5    When It Doesn't Boot    63

14.6    Chapter Summary    69

Debugging Embedded Linux Applications

15.1    Target Debugging    72

15.2    Remote (Cross) Debugging    73

15.3    Debugging with Shared Libraries    80

15.4    Debugging Multiple Tasks    87

15.5    Additional Remote Debug Options    97

15.6    Chapter Summary    99

Table of Contents

  1. Copyright
  2.  
  3. 14. Kernel Debugging Techniques
    1. 14.1. Challenges to Kernel Debugging
    2. 14.2. Using KGDB for Kernel Debugging
      1. 14.2.1. KGDB Kernel Configuration
      2. 14.2.2. Target Boot with KGDB Support
      3. 14.2.3. Useful Kernel Breakpoints
    3. 14.3. Debugging the Linux Kernel
      1. 14.3.1. gdb Remote Serial Protocol
      2. 14.3.2. Debugging Optimized Kernel Code
      3. 14.3.3. gdb User-Defined Commands
      4. 14.3.4. Useful Kernel gdb Macros
      5. 14.3.5. Debugging Loadable Modules
      6. 14.3.6. printk Debugging
      7. 14.3.7. Magic SysReq Key
    4. 14.4. Hardware-Assisted Debugging
      1. 14.4.1. Programming Flash Using a JTAG Probe
      2. 14.4.2. Debugging with a JTAG Probe
    5. 14.5. When It Doesn’t Boot
      1. 14.5.1. Early Serial Debug Output
      2. 14.5.2. Dumping the printk Log Buffer
      3. 14.5.3. KGDB on Panic
    6. 14.6. Chapter Summary
      1. 14.6.1. Suggestions for Additional Reading
  4. 15. Debugging Embedded Linux Applications
    1. 15.1. Target Debugging
    2. 15.2. Remote (Cross) Debugging
      1. 15.2.1. gdbserver
    3. 15.3. Debugging with Shared Libraries
      1. 15.3.1. Shared Library Events in GDB
    4. 15.4. Debugging Multiple Tasks
      1. 15.4.1. Debugging Multiple Processes
      2. 15.4.2. Debugging Multithreaded Applications
      3. 15.4.3. Debugging Bootloader/Flash Code
    5. 15.5. Additional Remote Debug Options
      1. 15.5.1. Debugging via Serial Port
      2. 15.5.2. Attaching to a Running Process
    6. 15.6. Chapter Summary
      1. 15.6.1. Suggestions for Additional Reading
3.141.199.243