Hi,
on a Linux machine, I am using ptrace with the PTRACE_SINGLESTEP parameter to count the number of machine instructions of a program. I followed this article: http://www.ncsu.edu/it/mirror/ldp/LDP/LGNET/81/sandeep.html.
However, the result seems odd to me. For a very simple program, over 95000 machine instructions are counted. The test program is
int main(void) { return 23; }
What's going on here? Is the code from the article wrong? (I can't see what's wrong with it.) If not, what causes such a simple program to require >95000 instructions?