Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: ClearScript, V8 and Eclipse

0
0
I have been trying to figure out for ages why I could not get Eclipse debugging working with my V8 scripts using ClearScript. Finally made a breakthrough.

The way my C# program uses ClearScript is that I run a standard C# program which calls a V8 script. The V8 script just runs, I have a call back set to check for runaway task and provide some hooks to call back into my C# program for additional complex "provider functions". Therefore when the V8 script terminates it is finished.

In the C# code I call ScriptEngine.execute(...) and it runs the code.

I have modified the sequence so that I have a main() in the V8 script and after running the code I issue a MessageBox.Show(...) to allow the Debugger to be connected, wait for connection then release the MessageBox and run ScriptEngine.executecommand("main()")

This all seems to be a bit prescriptive and am wondering if there is another way to hook the code into Eclipse/V8 debugger so that the code is hooked into the debugger prior to the 1st actual execution allowing me to set up breakpoints and without requiring all code to be inside a function which I execute after the initial ScriptEngine.execute??

Ideally an initial CallBack on Script Load assuming at this point that the Eclipse/V8 Debugger would be able to see the RunTime environment.

Viewing all articles
Browse latest Browse all 2297