Step over

Step over is more complicated, in this case we wanted to execute the call, and stop after it completes.

Interface

class debugger
{
public:
    void step_over();
}

Interface explained

The interface is deceptively simple. Read the implementation part if you do not agree.

Implementation.

Naturally, we just step as usual, but if we reach a call instruction, we put a breakpoint after the call instruction and resume execution. Guess what would happen? Some of the inner recursive call returns and break there, that isn't exactly what we want, so we will resume execution until we hit the breakpoint and the stack pointer is the same as the time we take the breakpoint. After that, continue single stepping until reaching the next statement.

results matching ""

    No results matching ""