Skip to content

jameshume/progtrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Program Execution Tracing

Use GCC function call tracing callbacks and BFD to trace program execution, function by function.

Partially based on EmbeddedFreedom's article on tracing and profiling function calls with GCC and addr2line.c.

You can get more information on JehTech.

To use, add the following lines to the CFLAGS for the program that you wish to trace:

CFLAGS +=-O0 -g -finstrument-functions

You will also need to either copy and paste trace_funcs.c into a file in the program you wish to trace or include it in the compilation.

Then run the program. It will generate the file trace.out.

You can then translate this binary output file into human readable format by compiling and running parse_trace_output.

make # outputs parse_trace_output and installs required dependencies
./parse_trace_output path/to/program/being/traced path/to/trace.out

About

Use BFD and gcc function trace callbacks to trace program execution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published