Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to go backwards while debugging Javascript in Chrome sources debugging?

Chrome sources debugging has buttons for step over, step into, and step out. There is no stepping backwards in time to see what were the previous functions.

like image 654
HaoQi Li Avatar asked Jul 05 '13 23:07

HaoQi Li


People also ask

How do I go back in debugger in Chrome?

One quick workaround I found out is to make a small change to the source file any change is fine (space, comment, whatever) while you are in the middle of the breakpoint then press Ctrl+s (save the file) and it will jump back to the first break point in that source.

Can you go backwards when debugging?

yes, this is not true backward debugging. but it is simple and very effective. to perform true backward stepping, the debugger would need to reverse all operations, typically with a rather heavy state machine and data recording.

How do I edit JavaScript while debugging?

After loading a web page completely, press the F12 key to open the developer tools, then open the 'Sources' tab. Now open any Javascript file loaded on the browser and you can directly edit it by clicking anywhere in that file. After making modifications press Ctrl+S to save the changes.


2 Answers

You can sort of go backwards if you click through in the "Call Stack" on the right side to see the parent functions.

like image 61
HaoQi Li Avatar answered Sep 28 '22 00:09

HaoQi Li


As I said on this answer, you can step back by placing a new breakpoint and restarting the actual function. Hope this makes the trick.

like image 44
Charly.Org Avatar answered Sep 27 '22 23:09

Charly.Org