Valgrind User Manual


Table of Contents

1. Introduction
1.1. An Overview of Valgrind
1.2. How to navigate this manual
2. Using and understanding the Valgrind core
2.1. What Valgrind does with your program
2.2. Getting started
2.3. The commentary
2.4. Reporting of errors
2.5. Suppressing errors
2.6. Command-line flags for the Valgrind core
2.6.1. Tool-selection option
2.6.2. Basic Options
2.6.3. Error-related options
2.6.4. malloc()-related Options
2.6.5. Uncommon Options
2.6.6. Debugging Valgrind Options
2.6.7. Setting default Options
2.7. The Client Request mechanism
2.8. Support for Threads
2.9. Handling of Signals
2.10. Building and Installing
2.11. If You Have Problems
2.12. Limitations
2.13. How It Works -- A Rough Overview
2.13.1. Getting started
2.13.2. The translation/instrumentation engine
2.13.3. Tracking the Status of Memory
2.13.4. System calls
2.13.5. Signals
2.14. An Example Run
2.15. Warning Messages You Might See
3. Memcheck: a heavyweight memory checker
3.1. Kinds of bugs that Memcheck can find
3.2. Command-line flags specific to Memcheck
3.3. Explanation of error messages from Memcheck
3.3.1. Illegal read / Illegal write errors
3.3.2. Use of uninitialised values
3.3.3. Illegal frees
3.3.4. When a block is freed with an inappropriate deallocation function
3.3.5. Passing system call parameters with inadequate read/write permissions
3.3.6. Overlapping source and destination blocks
3.4. Writing suppressions files
3.5. Details of Memcheck's checking machinery
3.5.1. Valid-value (V) bits
3.5.2. Valid-address (A) bits
3.5.3. Putting it all together
3.6. Memory leak detection
3.7. Client Requests
4. Addrcheck: a lightweight memory checker
4.1. Kinds of bugs that Addrcheck can find
5. Cachegrind: a cache profiler
5.1. Cache profiling
5.1.1. Overview
5.1.2. Cache simulation specifics
5.2. Profiling programs
5.2.1. Output file
5.2.2. Cachegrind options
5.2.3. Annotating C/C++ programs
5.2.4. Annotating assembler programs
5.3. cg_annotate options
5.3.1. Warnings
5.3.2. Things to watch out for
5.3.3. Accuracy
5.3.4. Todo
6. Massif: a heap profiler
6.1. Heap profiling
6.1.1. Why Use a Heap Profiler?
6.2. Using Massif
6.2.1. Overview
6.2.2. Basic Results of Profiling
6.2.3. Spacetime Graphs
6.3. Details of Heap Allocations
6.3.1. Accuracy
6.4. Massif options
7. Helgrind: a data-race detector
8. Nulgrind: the ``null'' tool
9. Lackey: a very simple profiler