Valgrind Technical Documentation

Release 3.2.3 29 January 2007


Table of Contents

1. The Design and Implementation of Valgrind
1.1. Introduction
1.1.1. History
1.1.2. Design overview
1.1.3. Design decisions
1.1.4. Correctness
1.1.5. Current limitations
1.2. The instrumenting JITter
1.2.1. Run-time storage, and the use of host registers
1.2.2. Startup, shutdown, and system calls
1.2.3. Introduction to UCode
1.2.4. UCode operand tags: type Tag
1.2.5. UCode instructions: type UInstr
1.2.6. Translation into UCode
1.2.7. UCode optimisation
1.2.8. UCode instrumentation
1.2.9. UCode post-instrumentation cleanup
1.2.10. Translation from UCode
1.2.11. Top-level dispatch loop
1.2.12. Lazy updates of the simulated program counter
1.2.13. Signals
1.2.14. To be written
1.3. Extensions
1.3.1. Bugs
1.3.2. Threads
1.3.3. Verification suite
1.3.4. Porting to other platforms
1.4. Easy stuff which ought to be done
1.4.1. MMX Instructions
1.4.2. Fix stabs-info reader
1.4.3. BT/BTC/BTS/BTR
1.4.4. Using PREFETCH Instructions
1.4.5. User-defined Permission Ranges
2. Callgrind Format Specification
2.1. Overview
2.1.1. Basic Structure
2.1.2. Simple Example
2.1.3. Associations
2.1.4. Extended Example
2.1.5. Name Compression
2.1.6. Subposition Compression
2.1.7. Miscellaneous
2.2. Reference
2.2.1. Grammar
2.2.2. Description of Header Lines
2.2.3. Description of Body Lines
3. Writing a New Valgrind Tool
3.1. Introduction
3.1.1. Tools
3.2. Writing a Tool
3.2.1. How tools work
3.2.2. Getting the code
3.2.3. Getting started
3.2.4. Writing the code
3.2.5. Initialisation
3.2.6. Instrumentation
3.2.7. Finalisation
3.2.8. Other Important Information
3.2.9. Words of Advice
3.3. Advanced Topics
3.3.1. Suppressions
3.3.2. Documentation
3.3.3. Regression Tests
3.3.4. Profiling
3.3.5. Other Makefile Hackery
3.3.6. Core/tool Interface Versions
3.4. Final Words