• yangguo's avatar
    [debugger] simplify step over recursive function call. · 2bb6e197
    yangguo authored
    The problem is this: when stepping over a recursive function call,
    the recursive function is flooded with one-shot break points so that
    we break after the call, but since the callee is the same function,
    the callee is also flooded, resulting a break in the callee. That
    however would have been a "step in" instead of "step over".
    
    The original solution was to recognize this by comparing FP. If we
    end up in Debug::Break, we still have to check the current FP against
    the remembered FP to see whether we are on the same stack height.
    If we are deeper, then it's not a "step over", and we do not trigger
    a debug break event. In that case, we queue up the step-over, and
    temporarily step out until we hit the desired stack height. Note that
    in order to step out, we flood the caller, which in our example is
    the same function as the callee. So we break at every flooded break
    location, and comparing with FP to make sure we stepped out prevents
    us from triggering debug break events.
    
    The new solution simply ignores breaks when the FP compare fails.
    We simply carry on until we hit a break where the FP compare succeeds.
    There is no need to do a step out. The number of calls to Debug::Break
    that do not trigger a debug break event due to failing FP compare is
    the same. But the code is a lot easier to read.
    
    R=jkummerow@chromium.org
    
    Review URL: https://codereview.chromium.org/1527253002
    
    Cr-Commit-Position: refs/heads/master@{#32897}
    2bb6e197
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
x64 Loading commit data...
x87 Loading commit data...
OWNERS Loading commit data...
debug-evaluate.cc Loading commit data...
debug-evaluate.h Loading commit data...
debug-frames.cc Loading commit data...
debug-frames.h Loading commit data...
debug-scopes.cc Loading commit data...
debug-scopes.h Loading commit data...
debug.cc Loading commit data...
debug.h Loading commit data...
debug.js Loading commit data...
liveedit.cc Loading commit data...
liveedit.h Loading commit data...
liveedit.js Loading commit data...
mirrors.js Loading commit data...