Analysis Tools for C++Analysis ToolsAnalyzers

Sanitizers

ASAN

  • g++ -fsanitize=address
  • clang++ -fsanitize=address
  • MSVC (as of 10/2019)

UBSAN

  • g++ -fsanitize=undefined
  • clang++ -fsanitize=undefined

LeakSanitizer

  • g++ -fsanitize=leak
  • clang++ -fsanitize=leak

ThreadSanitizer

  • g++ -fsanitize=thread
  • clang++ -fsanitize=thread

Stand-Alone Analysis Tools Stand-Alone Tools Stand-Alone

valgrind

  • code instrumentation framework
  • runs program on a VM
  • --tool=memcheck leak, invalid read/write detection
  • --tool=callgrind runtime profiling
  • --tool=cachegrind cache profiling
  • --tool=massif heap memory profiling
  • integration into various IDEs

Dr. Memory

  • dynamic instrumentation (runs on unmodified binaries)
  • leak detection
  • invalid memory read/write detection

HeapTrack

  • heap memory profiler
  • annotation of memory allocations

Application Verifier

Deleaker

  • memory leak detection
  • integration into various IDEs