28

I am really getting frustrated with Google Chrome... I have version 3.0.195.27 and want to debug some JavaScript that is working in IE, FF but not in Chrome.

When I open the debugger and mark breakpoints (the blue arrow thingy) and execute the JavaScript it hits the breakpoint and then I do not know how to step through code....I tried all function keys .....F5 causes the whole window to refresh....

Typing next in console window does nothing.....

Plus the debugger is very slow to further add salt to the wounds...

1
  • thanks a lot guys...i just wasnt looking hard enough...the buttons were there.... Commented Oct 16, 2009 at 7:04

5 Answers 5

66

I'm on Chrome 3.0.195.27, and I'm able to use the following keys:

  • F8 -> Run

  • F10 -> Step over

  • F11 -> Step into

Make sure you have focus on the JavaScript console.

Sign up to request clarification or add additional context in comments.

2 Comments

Same keys as in Opera
awesome still useful almost 5 years later
4

Use the pause, step over, step into, step out buttons at the right end of the inspector, below the search field and above the watch/call stack section.

Comments

3

In addition to the F8 (Run) F10 (Step over) and F11 (step into) you can single step your code by clicking on the line number at the left of each line and one at a time create a breakpoint on each line. Then by using F8 your code will run one line and stop at the next breakpoint. This has the effect of enabling you to single step through your code. If the next code line is a function then use F10 or F11 depending on the result you desire.

Someone voted down this answer, but didn't say why. A comment would be helpful. If you have a better way to single step through the code, please add a comment explaining your approach.

5 Comments

The better way to step through the code is not to use breakpoints on every line.
@NathanTuggy Do you know of another way. I was looking here and this seems like the only suggestion.
@cdignam: Well, the answer mentions the two better ways but does not explore them, instead recommending the ridiculously cumbersome technique of creating as many breakpoints as there are lines to step through. But F10 and F11 already step by one statement. So sure, set a breakpoint, but you only need one breakpoint to get to where you can single-step.
@NathanTuggy > But F10 and F11 already step by one statement. This is simply not true. They step over "next function call", which is entirely different.
@foverzar: F10 and F11 single-step exactly as much as "breakpoint every line" silliness.
1

I'm not sure if this is still relevant, but an easier way to debug (at least for a function): In the CDT console, type debugger, hit shift + enter; call the function you want to debug; hit enter. Then you can step through the function using the arrow keys in the debug tool.

Comments

-1

I recommend you to debug with FireBug. It is the absolutely best tool for it.

I have Chrome version 4.0.221.6, and there i got a button list where i can step in / step through

so maybe you need to update your Chrome version?

5 Comments

There is firebug lite extension for chrome as well.
Chrome devtools nowadays is better than firebug
This doesn't actually answer the question. It shows how to use firebug, not chrome dev tools. downvote plz
Look at the date of my answer. At the time i wrote this, chrome didn't have his own debugger yet. That's why i recommended firebug. So stop downvoting
@k0ni: if your answer is no longer correct, you should either delete it or update it for the sake of future readers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.