How to do remote Javascript debugging with Rhino in intellij IDEA? [duplicate] - javascript

I need to debug scripts running on a remote server which uses an embedded rhino engine, using intelliJ IDEA. Is there any procedure that I could follow to write a plugin to support this? I need an idea as how this could be done. It will be really helpful if you can either give me some idea or point me to some resources.

IDEA has xdebugger API to support debugging. You can use xslt debugger plugin sources as example.

Related

How can I find Htmlunit rhino version?

I am using the version of htmlunit 2.56.0.
As soon as JavaScript is executed in Java, the CPU is increasing a lot.
So I want to check the Rhino JavaScript engine version. How can I find it?
Or let me know if you know how to lower the CPU.
Thanks developers!!!
HtmlUnit uses a customized version of Rhino - you can find the repo here: https://github.com/HtmlUnit/htmlunit-core-js.
As HtmlUnit provides a bunch of patches to rhino the code is in sync with the latest code from the repo.
There are some issues open regarding js code (usually some obfuscated stuff) that shows this effect. If the url of the page is public please open an issue on github and i will try to have a look.
Even better if you can profile this or nail down the problem we are usually able to fix it or make improve Rhino itself to get this working.

Nashorn debugging API

In our application we have some scripts in JS written by users of our application. We use Nashorn for executing it. And we need to provide some debugging opportunities: at least breakpoints and variables watch.
As far as I understand, Nashorn has no debugging API.
I know about debugging with Idea or NetBeans IDE, but it is not suitable for us. We need debugging features in our own user interface.
Is it possible to implement debugging features in Nashorn? May be JPDA is only one way to achieve it?
JPDA is the way Netbeans debugger works with Nashorn. There are some supplementary callbacks in Debugger.java used to assist stack frames

mac os x python/JavaScript IDE where I can use break points

I looking for python/JavaScript IDE where I can put breakpoints. Currently I'm using coderunner but I can not put break points. I'll really appreciate you recommendations
I'm not an expert on Python, but I do work as a web developer and use JavaScript regularly. For that side of things, probably the easiest way is to use Chrome/Firefox debugger tools. You can do this manually by finding the line of code in the console and clicking (F12->Sources tab->Content scripts->desired script), or using the 'debugger' statement to toggle debug mode (F12->Console tab->type 'debugger' then return) and step through to what you need.
Additionally, if you're looking for an actual IDE, the only thing I've found online is the following. Here's the relevant part of that article. I've never used it (and probably never will), but there it is all the same.
Webstorm by IDEA supports setting breakpoints in the IDE. This requires launching the JavaScript debugger from IDEA. It must be configured in advance so it understands how to map JavaScript on the development server to JavaScript files in your environment. IDEA will automatically install a Chrome or Firefox plug-in to facilitate. This is pretty new technology and can be touchy.
I use PyCharm. It's a heavyweight IDE, so expect more features than you probably want if you're just getting started. It has a very good integrated debugger. You'll be able to break into both your Python and Javascript. Further, you'll see a pretty nice productivity jump with all the editing support like auto complete and intellisense. My advice is to stick with print() and logging as long as you can. For me getting a firm grasp of packages, python environments, virtualenv, command line tricks and git all before committing to the PyCharm IDE helped me adopt it with more confidence I was getting the value of all the integration.

Debug javascript using Eclipse

Ok, this is some question...well, I haven't seeing in any other place a question like this one...
I need to debug a javascript file through Eclipse (Helios)...but, that is not all, the javascript file is called by a third party application (C/C++) that runs (Mozilla) SpiderMonkey to execute the js file.
I need, someway to conect Eclipse to this application and get the debug symbols. Or, something like that...
Anyone see something like this before? Have an advice?
[EDITED]
Scenario:
The application (consoleApp.exe) runs the javascript engine SpiderMonkey embedded.
I need to, from Eclipse IDE, attach the application process and debug the current javascript source that SM is running.
Tks!
[THANKS!!!]
For anyone who gives a thought/comment/idea to answer this question. I figured out what i have to do, but, it will be difficult. I need to ask to modify the application core to expose the debug information coming from SpiderMonkey and JSD. And write an Eclipse plugin (or modify Pistol, maybe) to
comply with i want to do. Again, thanks to everyone.
You can try Firbug or Firefox web developer tools under Tools option.
In Eclipse:
JavaScript Development Tools (JSDT) - Eclipse.org
www.eclipse.org/webtools/jsdt/
I am not very sure about this but you can have a look into this
OR
The Google Chrome Developer Tools for Java allow debugging using Chrome.
It looks like Piston does exactly what you are asking for in your original question, although you cannot use it to debug your executable directly as in your clarification. Unfortunately, it also looks like it is hard to set up.
Doesnt Eclipse have something similar to .Net's 'Attach to process' under debug options? That way, you can easily debug your client side using your firebug, and whenever a server script is executed, your eclipse will debug it as if it were executed from there.

Venkman's javascript debugger

I'm trying to understand if I can debug a stand alone .js file which doesn't interact with browser. Is there any way to just load it and debug or I will be forced to encapsulate it into html file?
Environment is Windows, no browser objects are required.
To debug a stand-alone script, my first thought would be to use Rhino debugger -- have you tried that? I've also heard about v8 debug, but I have no experience with it yet.

Categories

Resources