Open Bug 1695217 Opened 4 years ago Updated 4 years ago

Being able to step out of a loop when there are breakpoints

Categories

(DevTools :: Debugger, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: Honza, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Originally reported here https://github.com/firefox-devtools/debugger/issues/7048

Let's see a pseudo code example but this is happening to me often when diagnosing :)

// breakpoint here on foo.
var foo = function2(something)
// foo is an array containing 100 elements.
foo.each(function(foo) {

    var blah = outside_fn(foo)

})
lol.where_I_want_to_be()


function outside_fn(bar) {
    // function with a breakpoint in there
    var breakit = bar;
}

There are two breakpoints in this code. One before foo.each() and one in a function nested in the loop. The code stops at the first breakpoint I continue the step by step and I enter the each loop.
After a couple of next step, I realize that the foo array is like a giant list. So I want to "step out" of the loop.

Because there is a breakpoint in outside_fn() the step out will loop to the next item and break again.

One way to go out of this is to set a breakpoint on lol.where_I_want_to_be() and to remove the breakpoint on the outside_fn() to be able to pursue the path. It's not very user friendly and requires a bit of mental gymnastics for remembering once you need to redo a round.

The desire

(probably unconventional for most devs)
Having the possibility to do a "step out and ignore breakpoints in the nested context". Aka put me just after the next step (mimicking what I had to do by hand, but without unticking the breakpoints.)

@miketaylr @digitarald list of my painful points/wishlist ;)

Made a glitch for the example: https://leaf-flare.glitch.me/

  var foo = Array.from({length: 100}, (_, i) => i);
  console.log(foo);
  foo = foo.map(function(i) {
    return mult(i, i)
  });

  console.log("DONE", foo);

  function mult(a, b) {
    const res = a * b;
    // add breakpoint here
    return res;
  }

I was thinking "continue to here" on the DONE console.log would work, but no, it stills pauses at the breakpoint in mult.

Attached image ignore-block-idea.png (deleted) —

One way of thinking about it, could also be the possibility to ignore this code block (here the loop). The same way we do for a full library but just at the block level.

And with the sketch of what it could be in my mind (but need the work of a real UX/designer person)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: