GCC: force a function call after each statement (for multi-threaded testing)?

I am trying to check a fairly thread-sensitive area in my program and wondered if there is a way to get gcc to insert a call after every command it emits, so that I can manually switch to another thread?

Thanks Robert

+3
source share
1 answer

No, GCC does not have this option.

However, you can hack a script that does this work. You can compile your assembler code using the -S option. The assembler generated by the compiler is relatively easy to parse.

.

+5

Source: https://habr.com/ru/post/1722945/


All Articles