Submitted by Nikhil Bhargava on Tue, 02/17/2004 - 14:37. Articles | General Interest This
article talks about debugging tools for applications in C on Linux
platforms. Most of the tools
are freely available on all major platforms with very wide user
support. The tools help in static analysis of code as well as assist in
dynamic evaluation of code.
Please note
that tools listed here are suggestions of the author. This list is not a
standard one. Changes have to be done in it depending upon the nature,
scope and details of the application to be developed. Debugging Tools
The
debug memory allocation or Dmalloc library is a freeware debugging tool
which has been specially
designed as a drop in replacement for the system's malloc, realloc,
calloc, free and other memory management routines while providing
powerful debugging facilities configurable at runtime. It makes changes
during compile time and donot add runtime changes
in binary. These facilities include such things as memory-leak
tracking, fence-post write detection, file/line number reporting, and
general logging of statistics. The library is reasonably portable having
been run successfully on at least the following operating
systems: AIX, BSD/OS, DG/UX, Free/Net/OpenBSD, GNU/Hurd, HPUX, Irix,
Linux, MS-DOG, NeXT, OSF, SCO, Solaris, SunOS, Ultrix, Unixware,
Windoze, and even Unicos on a Cray T3E. It has full support for programs
the debugging of POSIX threads.
The package includes the library, configuration scripts, debug utility application, test program, and
documentation.
Valgrind
is a GPL distributed system for debugging and profiling x86-Linux
programs. I can also be helpful
for programs for platforms other than x86 since behavior of x86 binary
is similar to other binaries. The accompanying tools with Valgrind
automatically detect many memory management and threading bugs, avoiding
hours of frustrating bug-hunting, making programs
more stable. It supports a through detailed profiling to help speed up
the programs.
The Valgrind distribution includes four tools: two memory error detectors, a thread errordetector,
and a cache profiler.
Electric
Fence is a freeware library that can be used for C programming and
debugging. It can be linked
at compile time and it will warn about possible problems such as
freeing memory that doesn't exist, etc. It is basically a memory
profiling tool. However currently it is available only on HP-Unix
platform (I am not very sure though).
This
is the Gnome Debugger which comes as a freeware support package with
freeware Linux distribution
like Red Hat, Slacware, and Debian etc. It has full support of many
languages like C, C++, and Perl etc. It helps to debug the binaries of
these languages in modes like single step, multiple step or complete
run. It also has provisions of setting break points
and trace value.
It is helpful for stub testing, functional flow checking and bound checking. Further this
is readily available with all flavours of Linux andUnix platforms and is amply supported in user community.
Insight
is a graphical user interface to GDB, the GNU Debugger written in
Tcl/Tk by at Red Hat, Inc.
and Cygnus Solutions Insight provides all features provided by GDB
along with Graphical debugging interface replacing traditional command
based interface.
MemProf
is a free ware memory Profiling and memory leak detection tool which
comes as an addendum to
common Linux distributions. It can generate a profile how much memory
was allocated by each function in the program. It can scan memory and
find blocks that have been allocated but are no longer referenced
anywhere (dead code).
MemProf
works by pre-loading a library to override the C library's memory
allocation functions and does
not require recompiling the program. One advantage MemProf has over
some other similar tools that are available is that it has a nice GUI
front-end and is relatively easy to use.
I am Nikhil Bhargava from Delhi, India. I am a Computer Engineer currently working in C-DOT, India for
past one year. Comments and Suggestions are always welcome.
Shell 腳本調試器,。 We have debuggers for bash, python, zsh, ksh, GNU make 3.81
and Python. In the patched sources for Make, we provide better error
handling and tracing. GNU Emacs support is included for all
debuggers....更多BASH
Debugger信息
libfiu是一個故障注入的C庫,。它提供用于標識“故障點”(“核心API”)里面的代碼,,功能啟用/禁用這些點的失敗(“控制API”),。核心API內部使用上要執(zhí)行故障注入代碼,。控制API用于內部測試代碼,,以控制注入失敗,。
libfiu is a C library for fault inject...更多l(xiāng)ibfiu信息
bdwgc (Boehm-Demers-Weiser conservative garbage collector)是個垃圾收集器,用來替代 C
malloc 或者是 C++ new,。bdwgc 也可以用其他編程語言實現,,但是要用 C 作為中間轉換語言。bdwgc 也可以用來檢測 C
或者 C++ 程序的漏洞,。舊版的垃圾收集器中包括...更多bdwgc信息