1  Introduction

1.1  An overview of Valgrind

Valgrind is a flexible tool for debugging and profiling Linux-x86 executables. The tool consists of a core, which provides a synthetic x86 CPU in software, and a series of "skins", each of which is a debugging or profiling tool. The architecture is modular, so that new skins can be created easily and without disturbing the existing structure.

A number of useful skins are supplied as standard. In summary, these are:

A number of minor skins (corecheck, lackey and none) are also supplied. These aren't particularly useful -- they exist to illustrate how to create simple skins and to help the valgrind developers in various ways.

Valgrind is closely tied to details of the CPU, operating system and to a less extent, compiler and basic C libraries. This makes it difficult to make it portable, so we have chosen at the outset to concentrate on what we believe to be a widely used platform: Linux on x86s. Valgrind uses the standard Unix ./configure, make, make install mechanism, and we have attempted to ensure that it works on machines with kernel 2.4 and glibc 2.2.X or 2.3.X. This should cover the vast majority of modern Linux installations.

Valgrind is licensed under the GNU General Public License, version 2. Read the file LICENSE in the source distribution for details. Some of the PThreads test cases, pth_*.c, are taken from "Pthreads Programming" by Bradford Nichols, Dick Buttlar & Jacqueline Proulx Farrell, ISBN 1-56592-115-1, published by O'Reilly & Associates, Inc.

1.2  How to navigate this manual

Valgrind is structured as a set of core services supporting a number of profiling and debugging tools ("skins"). This manual is structured similarly. Below, we continue with a description of the valgrind core, how to use it, and the flags it supports.

The skins each have their own chapters in this manual. You only need to read the documentation for the core services and for the skin(s) you actually use, although you may find it helpful to be at least a little bit familar with what all skins do. If you want to write a new skin, read this.

If you're new to all this, you're most likely to be using the Memcheck skin, since that's the one selected by default. So, read the rest of this page, and the section Memcheck.

Be aware that the core understands some command line flags, and the skins have their own flags which they know about. This means there is no central place describing all the flags that are accepted -- you have to read the flags documentation both for valgrind's core and for the skin you want to use.

1.2.1  For users migrating from valgrind-1.0.X

Valgrind-2.0.X is a major redesign of the 1.0.X series. You should at least be familiar with the concept of the new core/skin division, as explained above in the Introduction. Having said that, we've tried to make the command line handling and behaviour as backwards-compatible as we can. In particular, just running valgrind [args-for-valgrind] my_prog [args-for-my-prog] should work pretty much as before.