This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 220186 - Introduce a Pause action
Summary: Introduce a Pause action
Status: RESOLVED WONTFIX
Alias: None
Product: javascript
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: PLAN
Depends on:
Blocks:
 
Reported: 2012-10-16 15:49 UTC by Martin Entlicher
Modified: 2013-09-05 06:50 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

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 https://developer.chrome.com/extensions/manifest.html
   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