Reputation: 5124
I'm trying to walk the stack of this sample program:
#include <windows.h>
void Func1()
{
Sleep(1000);
}
void Func2()
{
Sleep(1000);
Func1();
}
void Func3()
{
Sleep(1000);
Func2();
}
void main()
{
for (int i = 0; i < 100; i++)
{
Func3();
}
}
In debug mode I get what you'd expect. Something like:
Sleep
Func3
main
In release mode (with frame pointer optimization enabled) I get the stack:
Sleep
main
Where did the function between "main" and "sleep" go in the release run?
Upvotes: 2
Views: 221
Reputation: 5124
The function was inlined.
I simply change the "Inline Function Expansion" to Only_inline (in VS2008) and the missing function appears. :)
Upvotes: 2