|home| |posts| |projects| |cv| |bookmarks| |github|

Cpp Tools of the Trade

Useful C++ tools that I use for different aspects of the development cycle.

Build

cmake

Cross-platform buildsystem generator.

ninja

Faster alternative for make.

ccache

Ccache is a compiler cache.

distcc

distcc distributes compilation of C code across several machines on a network.

Test

ctest

Ctest is the CMake test driver program. This program will run the tests and report results.

doctest

The fastest feature-rich C++11/14/17/20 single-header testing framework.

googletest

C++ testing framework developed by Google.

googlemock

Google's framework for writing and using C++ mock classes. It can help you derive better designs of your system and write better tests.

gcov and gcovr

gcov is a test coverage program.

Gcovr provides a utility for managing the use of the GNU gcov utility and generating summarized code coverage results.

llvm-cov

Coverage tool for clang/llvm, see more details here.

libFuzzer

Library for coverage-guided fuzz testing.

Here also LLVM code coverage tools are useful to see the coverage generated by running the fuzzers.

codechecker

CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy.

Runtime checks

valgrind

memcheck

Memory error detector.

hellgrind and drd

Thread error detectors.

sanitizers

Address sanitizer

Memory error detector(faster alternative for valgrind memcheck).

Thread sanitizer

Data race detector(faster alternative for valgrind hellgrind/drd).

UndefinedBehavior sanitizer

Undefined behavior detector.

Performance

Linux perf tool

stat

Runs a command and gathers performance counter statistics from it.

record/report

Runs a command and gathers performance counter profile from it.

The profile can be inspected later on, using perf report.

Flamegraphs

Flame graphs are a visualization for sampled stack traces, which allows hot code-paths to be identified quickly.

gperftools

gperftools is a collection of a high-performance multi-threaded malloc() implementation, plus some pretty nifty performance analysis tools.

pprof

pprof is a tool for visualization and analysis of profiling data.

/usr/bin/time

Better alternative for builtin shell comand. Runs program and summarizes system resource usage.

google benchmark

A library to benchmark code snippets, similar to unit tests.

Compiler explorer

Web app that can show the assembly generated by various compilers.

valgrind profilers

CPU

cachegrind and callgrind.

Heap

massif and DHAT.

BPF Compiler Collection(bcc)

IDE

I use these tools in emacs. Some of them are specific to emacs but most of them are available in any editor(vim, vscode etc.).

clangd

C++ language server. clangd understands your C++ code and adds smart features to your editor: code completion, compile errors, go-to-definition and more.

clang-format

Automatic source code formatting based on Clang.

clang-tidy

clang-based C++ "linter" tool.

magit

Git frontend inside emacs.

org-mode

Not C++ related but worth mentioning.

Org mode is for keeping notes, maintaining to-do lists, planning projects, authoring documents, computational notebooks, literate programming and more — in a fast and effective plain text system.