views:

208

answers:

2

I am recently working on dojo. And sometimes I need the help of chrome debugger help to understand how the function actually works. But right now, I have a problem. I want to add a breakpoint at a specified function. I know the function name already. But since the dojo source file is compressed, I cannot add the breakpoint at the specified line directly. I noticed that there is a way to debug javascript with commandline in Chrome2. But right now, I cannot find the debugger with commandline capability. Does the latest Chrome have any command line tools for debugging or just a graphical one?

Thanks!

A: 

Hi, By using the Web Inspector which is included with Google Chrome, you can use the command line console issuing various JavaScript commands: http://blog.chromium.org/2009/06/developer-tools-for-google-chrome.html

  1. Right click on your page, choose "Inspect element",
  2. Click on the console tab.
  3. Start typing.

There are other debuggers as well such as Chrome developer tools for Eclipse, http://blog.chromium.org/2009/08/google-chrome-developer-tools-for.html, it is kind of nice using the Eclipse debugger.

Mohamed Mansour
It seems that the first way you recommended does not meet my requirement. I found I could type in the console, however, I could only watch variables by typing the variable name. I can not add a breakpoint in the console. Do I missing something? Or does chrome miss some functionality?
xiao
+1  A: 

I think you need to get yourself an unminified version of dojo. It comes in the development kit and is called dojo.js.uncompressed.js (use this file instead of dojo.js). You can search the code with your text editor, find the line you want and set a breakpoint there.

Igor Zevaka
I noticed that there is a uncompressed version of dojo. But the source code has no blankline either. Very difficult to add a right breakpoint with a graphical debug tool.
xiao