Difference between revisions of "Development tools"
(draft) |
(v1.0) |
||
Line 1: | Line 1: | ||
+ | == Building == | ||
+ | |||
+ | See [[Build Tools]]. | ||
+ | |||
+ | == Documentation == | ||
+ | |||
+ | === Built-in === | ||
+ | |||
+ | The D programming language has a built-in code documentation language ([http://dlang.org/ddoc.html DDoc]) and documentation generation, enabled by the <tt>-D</tt> compiler switch. | ||
+ | |||
+ | === Third-party === | ||
+ | |||
+ | See the documentation generators section in [[Community:Open_Source_Projects]]. | ||
+ | |||
+ | == Source code == | ||
+ | |||
+ | * [https://github.com/Hackerpilot/dfmt dfmt] - formats D code | ||
+ | |||
+ | * [https://github.com/Hackerpilot/dfix dfix] - automatically updates D code | ||
+ | |||
+ | See also: [[Bindings#Binding_generators|Binding generators]] | ||
+ | |||
== Debugging == | == Debugging == | ||
Line 19: | Line 41: | ||
See the [[Debuggers]] page for a list of third-party debuggers. | See the [[Debuggers]] page for a list of third-party debuggers. | ||
+ | |||
+ | See also: [[Troubleshooting Tools]] | ||
== Profiling == | == Profiling == | ||
Line 33: | Line 57: | ||
Starting with DMD 2.068, the D compiler can instrument memory allocations, and save a report on program exit. | Starting with DMD 2.068, the D compiler can instrument memory allocations, and save a report on program exit. | ||
This is enabled by the <tt>-profile=gc</tt> compiler switch. | This is enabled by the <tt>-profile=gc</tt> compiler switch. | ||
+ | |||
+ | === Third party === | ||
+ | |||
+ | ==== CPU profiling ==== | ||
+ | |||
+ | * Callgrind (from Valgrind) works well with D. D symbols will need be demangled (see [[#Demangling]] below). | ||
+ | |||
+ | * [https://github.com/VerySleepy/verysleepy Very Sleepy] is a polling CPU profiler for Windows which works well with D. Debug information must be in PDB format (can be done by compiling with <tt>-m64</tt>, <tt>-m32mscoff</tt>, or by converting it using [https://github.com/rainers/cv2pdb cv2pdb]). | ||
+ | |||
+ | ==== File size profiling ==== | ||
+ | |||
+ | * [http://thecybershadow.net/d/mapview/ D map treemap viewer] can visualize a .map file in a treemap, and allows seeing at a glance what is using the most space in a compiled executable. Generating map files can be enabled with the <tt>-map</tt> compiler switch. | ||
+ | * On the same page is a tool which attempts to disassemble an ELF binary, and finds which symbol is pulling in which symbol. | ||
== Integration == | == Integration == | ||
Line 43: | Line 80: | ||
=== D language development === | === D language development === | ||
− | These tools may be helpful when working on D itself: | + | These tools may be helpful when submitting D bugs, or when working on D itself: |
+ | |||
+ | * [https://github.com/CyberShadow/DustMite DustMite] can reduce a large program to a small one by performing reductions which satisfy a given condition (e.g. that a certain error message is reproduced). | ||
+ | |||
+ | * [https://github.com/CyberShadow/Digger Digger] can build D, including old versions of D, and bisect D's history to find which commit fixed or introduced a bug. | ||
+ | |||
+ | * [http://digger.k3.1azy.net/trend/ TrenD] ("Is D slim yet?") measures and visualizes D's history across a number of parameters. | ||
== Other == | == Other == |
Revision as of 15:43, 8 May 2015
Building
See Build Tools.
Documentation
Built-in
The D programming language has a built-in code documentation language (DDoc) and documentation generation, enabled by the -D compiler switch.
Third-party
See the documentation generators section in Community:Open_Source_Projects.
Source code
- dfmt - formats D code
- dfix - automatically updates D code
See also: Binding generators
Debugging
Built-in
Language features
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.
Coverage analysis
The D compiler can generate code coverage reports, enabled by the -cov compiler switch. See the Code Coverage page for more information.
Third-party
See the Debuggers page for a list of third-party debuggers.
See also: Troubleshooting Tools
Profiling
Built-in
CPU profiling
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.
Heap profiling
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.
Third party
CPU profiling
- Callgrind (from Valgrind) works well with D. D symbols will need be demangled (see #Demangling below).
- Very Sleepy is a polling CPU profiler for Windows which works well with D. Debug information must be in PDB format (can be done by compiling with -m64, -m32mscoff, or by converting it using cv2pdb).
File size profiling
- D map treemap viewer can visualize a .map file in a treemap, and allows seeing at a glance what is using the most space in a compiled executable. Generating map files can be enabled with the -map compiler switch.
- On the same page is a tool which attempts to disassemble an ELF binary, and finds which symbol is pulling in which symbol.
Integration
Demangling
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 submitting D bugs, or when working on D itself:
- DustMite can reduce a large program to a small one by performing reductions which satisfy a given condition (e.g. that a certain error message is reproduced).
- Digger can build D, including old versions of D, and bisect D's history to find which commit fixed or introduced a bug.
- TrenD ("Is D slim yet?") measures and visualizes D's history across a number of parameters.