chappar
chappar

Reputation: 7525

Debugging with frame pointer optimization on

How does the debugger gets the stack information with FPO on? I read somewhere that the .pdb files contain FPO information that debugger uses to get the stack info. So, what does the pdb file contain that help debugger to get the stack trace?

For example the debugger has hit a break point and it has ESP and pdb file. So, how does the debugger show me the call stack?

Upvotes: 4

Views: 443

Answers (1)

Martin
Martin

Reputation: 21

Stack info is stored in the .pdata section of the executable. see here: Prolog and Epilog and here: pdata section

So the debugger can lookup the location of the current code and determine the stack layout of the current function by looking up the unwind info in the .pdata section. Then it can determine the return address and repeat this process with the function returned to, and so on... creating a stack trace.

Upvotes: 2

Related Questions