Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 220186 - Introduce a Pause action
Introduce a Pause action
Product: javascript
Classification: Unclassified
Component: Debugger
PC Linux
: P3 (vote)
: 7.4
Assigned To: Martin Entlicher
Depends on:
  Show dependency treegraph
Reported: 2012-10-16 15:49 UTC by Martin Entlicher
Modified: 2013-09-05 06:50 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2012-10-16 15:49:42 UTC
Request to pause on the next JavaScript statement.
Comment 1 Martin Entlicher 2013-02-27 17:09:10 UTC
Unfortunately, we're not able to implement this. :-(
The problem is the additional script, that is added to the page and that does highlighting and other work. Most probably the pause action will suspend execution of this NetBeans script rather than the user code. The NetBeans script is active on mouse movement.

I've tried two approaches to solve this and neither works.
1) Debugger.pause does not accept an contextId, but I've tried to check
   whether running NetBeans script in an isolated context would help.
   The execution context creates an isolated world to separate application
   execution and NetBeans' script execution. It can be created via
   listing the scripts in "content_scripts" section of manifest file as
   described at
   But even if NetBeans scripts can be adapted to work in the separate
   execution context, the pause action is really global, it suspends
   the NetBeans scripts again.
   If we execute code in a separate non-page execution context via
   Runtime.evaluate, it blocks when pause was requested.

2) As soon as some JavaScript code is paused, we can examine the call stack
   to find out that the NetBeans script got suspended. We can do resume
   and request the pause again. But the problem is, that a lot of code
   can be executed in between. When a user code is executed right after
   the NetBeans script, several thousands of iterations are processed till
   the code is paused. Common user code will be processed before pause has
   effect. Pause must be called after resume, calling pause before resume
   has no effect. It's not possible to use stepping, since different
   scripts are processed and it's not possible to step from one to another.
   There are, obviously, no calls between NetBeans script and user script.
Comment 2 tomzi 2013-09-05 06:50:40 UTC
What about 'creating' sth like virtual breakpoints either on everys script line in the user code or at least on every block statement, like begin of methods, loops.... 

These 'virtual' breakpoints would not be shown to the user, but will be created by netbeans before continueing the debugger and 'removed' after that.

Instead of letting the user do all the breakpoint setting a.s.o

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo