I need to trace all instrutions of a program using gdb. After every execution of a instruction, I want gdb invokes a specified function.
Is it a possiable work? How to achieve this?
I searched internet and found "stepi arg" command in gdb could step arg instructions. But how to find total number of instructions? After every instruction, how to make gdb to invoke my function automately?