Wheel Reinvention Jam 2022 Project

In a generic debugger you can inspect the current program state, and step along with the program to find out what the next state will be, but if an error occurs you have no idea what the program has been doing before. This project aims to prototype a solution that automatically inserts tracing code, which outputs a complete list of all the functions called and branches taken. This can be interpreted to know every instruction and every line of code executed.

Some possible uses:

  • Match a free against a previous malloc, and the context & callstack of that malloc
  • Search back in time in your program for functions that might have changed your program state, if you want to know why you have a use after free, invalid pointers or other kinds of bugs.

Recent Activity

Didn't have a lot of time so I didn't finish or get much done for my jam project, but at least I have something...
It modifies .obj's and inserting tracing code. When you run your program, it records where branches and calls are going, and saves that to a file. Then, the user can use another program to view the data which deduces the full execution path and you can look at what your program did, zoom into function calls, etc..
I also wanted to make it work for indirect calls & jmps and in general for bigger programs, and add searching capabilities and recording function args and return values, but alas, no time. That would allow you to do things like search for where in your program you allocated memory, match malloc's to free's, investigate use-after-free's, etc.. &rainman
Also fun fact: a recursive function actually exhibits a Droste effect

Capturing all the instructions executed by a program &rainman