Closed Bug 1145747 Opened 10 years ago Closed 6 years ago

Debugger step functions are sensitive to whitespace

Categories

(DevTools :: Debugger, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: callahad, Unassigned)

References

(Blocks 1 open bug)

Details

If you set a breakpoint on the first line of foo(), then click "step in" on each line, the debugger takes a different number of steps to reach the bar() function depending on whitespace in the function arguments. function foo() { var a = bar('one step to bar', { foo: 1, bar: 2, baz: { qux: true } }); var b = bar('three steps to bar', { foo: 1, bar: 2, baz: { qux: true } }); var c = bar('four steps to bar', { foo: 1, bar: 2, baz: { qux: true } }); } function bar(subject, opts) { return true; } I find this somewhat confusing and unintuitive -- the code is syntactically identical, but the debugger behaves different in each case.
For easy testing, the above code can be found at http://people.mozilla.org/~dcallahan/tmp/bug1145747.html
See Also: → 1370641
In essence the idea here would be either to column-step through the arguments, or not to emit line notes for the arguments. I'm not sure where I come down on this. For "obvious" arguments, there seems to be no point in stepping through them -- it's not as though one can inspect the intermediate values created while stepping anyway. Abstractly my preferred approach to line-notes would be to emit them at user-visible spots only, and not for intermediate calculations. However, an otherwise innocuous-looking intermediate expression might involve a getter or other non-obvious behavior, and this isn't generally known during bytecode emission, and one might want to be made aware of this while stepping.
Product: Firefox → DevTools

Dan, I think we fixed this with a feature we call breakpoint specificity a couple of months ago where we cleaned up all of the possible locations you could step to. Would you mind re-testing?

Status: NEW → UNCONFIRMED
Ever confirmed: false
Flags: needinfo?(callahad)
Blocks: dbg-control
Type: enhancement → defect

This does indeed appear to be fixed!

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(callahad)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.