lks9 / src-tracer

Other
0 stars 0 forks source link
c instrumentation trace

Source Tracer

This is a draft of a control flow tracer based on source code instrumentation with a low overhead. Instrument your software with instrumenter.py. When running instrumented software, the trace is written into a file. The format is basically one character (plus an optional number) for each source code block on the trace. For accurate retracing, retrace.py uses symbolic execution.

Which Software to Trace

Any software which is written in C/C++, with the source code available.

Dependencies

For the Instrumentation

For the Trace Recording

For the Symbolic Replayer

Setup

Example checksum.c

Other Example

An example to instrument and retrace busybox with musl-libc can be found in the wiki

Other Software

You can do it manually as for the checksum.c example.

For a more automatic way that works well with make scripts, make use of cc_wrapper/.

Recording

Retracing

It can be a bit tricky to get the binary linking correctly, make sure that the record/replay executable includes the record/replay version of the app and its libraries.