Backward is a useful tool for C++ developers for diagnosing bugs.

In a nut shell, when a program terminates abnormally, Backward prints out the line in the source code that causes the trouble. It does this by catching signals and relies on either elfutils or GNU/binutils libraries to print out the debugging symbols in the executable.

To use it is as simple as 1, 2 3:

  1. include backward.hpp in the source file
  2. compile the source code with debugging symbols. i.e. compile with -g flag.
  3. link with elfutils or GNU/binutils library

Leave a Reply 請留下你的回應