intel-pin

Intel PIN: get backtrace on windows


I'm trying to write a pintool on windows. One thing I want to do is print stack trace after specific instructions. According to the Pin Manual, the PIN_Backtrace is only available on Linux and Mac OS. Is there any equivalent solutions on Windows?


Solution

  • Create a shadow stack instead instrumenting all the routines in all the modules using RTN_InsertCall at both IPOINT_BEFORE and IPOINT_AFTER, and modifying the Shadow stack(s) accordingly.

    This way you can print the Shadow stack and don't need the backtrace.