Skip to content

V8ScriptEngine: Event OnDebuggerConnected? #518

@DavidBal

Description

@DavidBal

Hi ClearScript Team,

at the moment i am working on project that integrates your V8ScriptEngine.

I am now at a point where i would like to implement debugging.
I would like know if there is a possibilty for a event that is fired when a Debugger is connected to the V8ScriptEngine?
At the moment i am doing this as a workaround:

using (V8ScriptEngine scriptEngine = new V8ScriptEngine(V8ScriptEngineFlags.EnableTaskPromiseConversion | V8ScriptEngineFlags.EnableDateTimeConversion | V8ScriptEngineFlags.EnableDebugging | V8ScriptEngineFlags.AwaitDebuggerAndPauseOnStart ))
{
       if (debug)
       {
            scriptEngine.Evaluate("debugger;");
            DebuggerConnected?.Invoke(this, EventArgs.Empty);
        }
        
        //execute the Script ...
}

The problem with this workaround is that the user always starts in this empty script.

Is there a better way i can handle this case?

Thanks in advance for your answer.

Best regards,
David

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions