Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodeclipse Debugger stops on the first line, even after clearing all breakpoints

I believe this is a bug in the NodeClipse IDE for Eclipse. Even after I delete all the breakpoints in the IDE, the debugger stops on the first line, it is driving me nuts. At the end of the day having to look for the minuscule "Continue" button is taking a toll on my patience.

Anyone having the same issue? How did you fix this?

Here is an image of the problem :

http://joaorosilva.no-ip.org/public/stackoverflow/Screen%20Shot%202013-07-04%20at%2015.35.37.png

like image 846
João Rocha da Silva Avatar asked Oct 03 '22 15:10

João Rocha da Silva


1 Answers

There is no such thing as "NodeClipse IDE"

There are

  • nodeclipse plugin (nodeclipse-1)
  • Enide (set of plugins)
  • Nodeclipse NTS (Eclipse distribution)

You should have mentioned what exact version of Nodeclipse and Eclipse are you using. I am using Nodeclipse NTS 0.4.10 (based on Eclipse 4.3 Kepler) every day now.

Just press F8 to resume.

Since Nodeclipse 0.6 there is option to "no -break", that will use --debug without interrupting Node app on 1st line.

From Node wiki

There are 2 debug related node options:

node --debug[=port] NodeApp.js

node --debug-brk[=port] NodeApp.js

The --debug option will just enable remote debugger connection on given port and then start the application normally. Even when debugger is connected to the running node instance later on, the script execution will not be stopped until “Suspend” command is issued by Eclipse debugger. Another way to stop the execution is to browse the source code of the JavaScript modules comprising the application and double click on the line number at the desired position in script to break at (most likely a callback). Once execution stops you can set/clear more breakpoints, but also inspect call stack and view content of all program variables.

The --debug-brk option is needed when your script is short lived (no time to attach debugger) and/or you want to observe the NodeApp.js execution from the very start. This option will force execution to break at the first line of the main script and wait for debugger to connect. The behavior upon connection is now different – the script is suspended and no breakpoints are set. Note that V8 engine debugger is not behaving very good when it steps over or steps into require() method (it will crash), so try to set up first breakpoint past the initial module loading. This will also enable you to set breakpoints in any of those modules as well.

That is, if --debug is used, than small apps and beginning of an application are impossible to debug.

like image 120
Paul Verest Avatar answered Oct 10 '22 02:10

Paul Verest