Search in sources :

Example 1 with TruffleExecutionContext

use of com.oracle.truffle.tools.chromeinspector.TruffleExecutionContext in project graal by oracle.

the class WebSocketServer method openWebSocket.

@Override
protected NanoWSD.WebSocket openWebSocket(NanoHTTPD.IHTTPSession handshake) {
    String descriptor = handshake.getUri();
    TruffleExecutionContext context = SESSIONS.get(descriptor);
    if (log != null) {
        log.println("CLIENT ws connection opened, resource = " + descriptor + ", context = " + context);
        log.flush();
    }
    if (context != null) {
        boolean debugBreak = DEBUG_BRK.get(descriptor);
        RuntimeDomain runtime = new TruffleRuntime(context);
        DebuggerDomain debugger = new TruffleDebugger(context, debugBreak);
        ProfilerDomain profiler = new TruffleProfiler(context);
        InspectServerSession iss = new InspectServerSession(runtime, debugger, profiler, context);
        return new InspectWebSocket(handshake, iss, log);
    } else {
        return new ClosedWebSocket(handshake);
    }
}
Also used : RuntimeDomain(com.oracle.truffle.tools.chromeinspector.domains.RuntimeDomain) DebuggerDomain(com.oracle.truffle.tools.chromeinspector.domains.DebuggerDomain) TruffleExecutionContext(com.oracle.truffle.tools.chromeinspector.TruffleExecutionContext) TruffleRuntime(com.oracle.truffle.tools.chromeinspector.TruffleRuntime) TruffleDebugger(com.oracle.truffle.tools.chromeinspector.TruffleDebugger) ProfilerDomain(com.oracle.truffle.tools.chromeinspector.domains.ProfilerDomain) TruffleProfiler(com.oracle.truffle.tools.chromeinspector.TruffleProfiler)

Example 2 with TruffleExecutionContext

use of com.oracle.truffle.tools.chromeinspector.TruffleExecutionContext in project graal by oracle.

the class InspectorTestInstrument method onCreate.

@Override
protected void onCreate(Env env) {
    TruffleExecutionContext context = TruffleExecutionContext.create("test", env, new PrintWriter(env.err()));
    TruffleRuntime runtime = new TruffleRuntime(context);
    TruffleDebugger debugger = new TruffleDebugger(context, suspend);
    TruffleProfiler profiler = new TruffleProfiler(context);
    InspectServerSession iss = new InspectServerSession(runtime, debugger, profiler, context);
    env.registerService(iss);
    env.registerService(context.getId());
}
Also used : InspectServerSession(com.oracle.truffle.tools.chromeinspector.server.InspectServerSession) TruffleExecutionContext(com.oracle.truffle.tools.chromeinspector.TruffleExecutionContext) TruffleRuntime(com.oracle.truffle.tools.chromeinspector.TruffleRuntime) TruffleDebugger(com.oracle.truffle.tools.chromeinspector.TruffleDebugger) TruffleProfiler(com.oracle.truffle.tools.chromeinspector.TruffleProfiler) PrintWriter(java.io.PrintWriter)

Aggregations

TruffleDebugger (com.oracle.truffle.tools.chromeinspector.TruffleDebugger)2 TruffleExecutionContext (com.oracle.truffle.tools.chromeinspector.TruffleExecutionContext)2 TruffleProfiler (com.oracle.truffle.tools.chromeinspector.TruffleProfiler)2 TruffleRuntime (com.oracle.truffle.tools.chromeinspector.TruffleRuntime)2 DebuggerDomain (com.oracle.truffle.tools.chromeinspector.domains.DebuggerDomain)1 ProfilerDomain (com.oracle.truffle.tools.chromeinspector.domains.ProfilerDomain)1 RuntimeDomain (com.oracle.truffle.tools.chromeinspector.domains.RuntimeDomain)1 InspectServerSession (com.oracle.truffle.tools.chromeinspector.server.InspectServerSession)1 PrintWriter (java.io.PrintWriter)1