conferences | speakers | series

Debug your build by tracing and reversing

home

Debug your build by tracing and reversing
FOSDEM 2018

Can you tell exactly which source files are built into your binaries? Any sufficiently large build feels a bit like magic! Join me to explore how you can debug your build by stracing it and rebuilding a build graph of files and tools transformations.

Some applications for this knowledge:

  • better control of which subset of the code you use and depend on.
  • general build hygiene and debugging such as pruning obsolete or dead code.
  • build optimization

And answer some questions such as:

  • if a file is really used or not and where it is used and what for.
  • how it was compiled and combined
  • what are your build dependencies.

I will present a TraceCode, a FOSS tool that uses build-time syscalls tracing to reconstruct your build graph. Using build tracing with strace (disclaimer: I am a small-time contributor to strace ), you capture a complete trace of all the systems calls happening during your build.

The trace is then parsed and processed to reconstruct the build graph of your binaries as a directed graph of files transformations over tools such as code generators, scripts, compilers, assemblers, linkers, etc. This requires NO modification of your build at all.

The graph can then be analyzed for fun and profit, including creating fancy dot graphic visualizations and can help understand exactly which files were built, by what and how they were transformed in multiple steps from sources to your final binaries.

As a bonus, I will also present new FOSS extension that perform similar build reversing but using static analysis only.

Speakers: Philippe Ombredanne