I am working with devtools debugger provided by google chrome. In terms of execution control, it allows you to add breakpoints anywhere in script and even allows you to attach breakpoints to events. You can step line by line in a script. You can step over functions to remain in the same function or step into functions. And when you go into functions, you can step out of the function to go back to the caller.
One problem I have is sometimes when I step over a function call, I want to go back to it, in order to step into that function call. I read over https://developer.chrome.com/devtools/docs/javascript-debugging and I cannot find a way to do this. Am I overlooking anything or is there a way to "step back"?
When you are debugging a program, it is not unusual to realize that you have gone too far, and some event of interest has already happened. If the target environment supports it, gdb can allow you to “rewind” the program by running it backward.
Chrome DevTools: Quickly jump to other code while debugging JavaScript. You can easily jump, via the debugger, to new JavaScript destinations when you are paused at a breakpoint. To do this, hold the Cmd/Ctrl key while you are paused at a breakpoint. DevTools displays jumpable destinations.
Old question, but with "new" info:
Recently the Chrome DevTools got a boost, and now you can "restart" the function that you are debugging. This allows you to set a breakpoint in the previous line, so it looks like a "backwards" button. This can be done by right-clicking on the call stack and select the "Restart frame"
Even being an old question, I think this worths spreading.
I hope this is useful for someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With