Bug 74107

Summary: Web Inspector: [protocol] Debugger.setScriptSource response should include "stepInRecommended" field
Product: WebKit Reporter: Peter Rybin <peter.rybin>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: apavlov, burg, bweinstein, joepeck, keishi, loislo, peter.rybin, pfeldman, pmuellr, rik, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   

Description Peter Rybin 2011-12-08 11:14:41 PST
This field tells frontend that performing "step in" will make application state more consistent. This is important for user experience.
Comment 1 Timothy Hatcher 2011-12-08 14:04:03 PST
Can you provide more information about this?
Comment 2 Peter Rybin 2012-04-23 10:25:54 PDT
Steps to demonstrate.

1. In JavaScript debugger stop in any multi-line multi-statement function.
For example at site http://www.artlebedev.ru/ in script "colors.js" put a breakpoint in function "hsv2rgb" at any statement but last, debugger will stop there promptly.

2. Note the stack structure.
For example:
-> hsv2rgb
-  SetLogoColor
-  SlightlyAlterColor

3. Modify body of the function you stopped in (in this example "hsv2rgb") and press Ctrl+S.

4. Top function gets dropped from the stack. Cursor is now at the previous function (in this example "SetLogoColor").

5. Try "Step over" debugger action.

Expected:
Cursor moved to the next statement within the current function ("SetLogoColor") or leaves it if it was the last statement.

Actual:
Execution jumps inside original function ("hsv2rgb") as if user pressed "Step in" instead of "Step over".
Comment 3 Peter Rybin 2012-04-23 10:29:16 PDT
This happens because after liveedit operation V8 remains in slightly inconsistent state, when the top function is not visible on stack, but from the "step over" point of view, we are at the pre-beginning of the top function.

That's why it's recommended for the front-end to issue additional "step in" command.

It's hard for V8 to do it itself for the technical reasons.