News Archive (1999-2012) | 2013-current at LinuxGizmos | Current Tech News Portal |    About   

Mastering Linux debugging techniques [developerWorks]

Aug 17, 2002 — by LinuxDevices Staff — from the LinuxDevices Archive — 11 views

There are various ways to watch a running user-space program: you can run a debugger on it and step through the program, add print statements, or add a tool to analyze the program. This technical article at IBM's developerWorks website describes methods you can use to debug programs that run on Linux. The article reviews four scenarios for debugging problems, including segmentation faults, memory overruns and leaks, and hangs. Steve Best (JFS core team member, IBM) writes . . .

“This article presents four scenarios for debugging Linux programs. For Scenario 1, we use two sample programs with memory allocation problems that we debug using the MEMWATCH and Yet Another Malloc Debugger (YAMD) tools. Scenario 2 uses the strace utility in Linux that enables the tracing of system calls and signals to identify where a program is failing. Scenario 3 uses the Oops functionality of the Linux kernel to solve a segmentation fault problem and shows you how to set up the kernel source level debugger (kgdb) to solve the same problem using the GNU debugger (gdb); the kgdb program is the Linux kernel remote gdb via serial connection. Scenario 4 displays information for the component that is causing a hang by using a magic key sequence available on Linux . . .”

Read full story

 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.