The D programming language has built-in support for a number of debugging features:
- Asserts, invariants, and contract programming (enabled by default, disabled by the -release compiler switch)
- Array bounds checking (enabled by default, disabled by the -release or -boundscheck=off compiler switches)
- Unit tests (enabled by the -unittest compiler switch.
The D compiler can generate code coverage reports, enabled by the -cov compiler switch. See the Code Coverage page for more information.
See the Debuggers page for a list of third-party debuggers.
The D compiler can instrument generated code to measure per-function profiling information, and save a report on program exit. This is enabled by the -profile compiler switch.
Starting with DMD 2.068, the D compiler can instrument memory allocations, and save a report on program exit. This is enabled by the -profile=gc compiler switch.
To demangle D symbols emitted by third-party programs, pipe the output through the ddemangle tool. The tool will recognize D symbols in its input, and replace them with the demangled versions, while outputting all other input intact.
D language development
These tools may be helpful when working on D itself: