Search in sources :

Example 1 with AddBreakpointResponse

use of org.eclipse.che.plugin.zdb.server.connection.ZendDbgEngineMessages.AddBreakpointResponse in project che by eclipse.

the class ZendDebugger method handleSessionStarted.

private void handleSessionStarted(SessionStartedNotification notification) {
    if (!sendSetProtocol()) {
        sendCloseSession();
        LOG.error("Unsupported protocol version: " + notification.getServerProtocolID() + ", only most recent protocol version: " + SUPPORTED_PROTOCOL_ID + " is supported.");
    }
    debugStartFile = notification.getFileName();
    if (debugSettings.isBreakAtFirstLine()) {
        AddBreakpointResponse response = debugConnection.sendRequest(new AddBreakpointRequest(1, 1, -1, debugStartFile));
        if (isOK(response)) {
            breakpointAflId = response.getBreakpointID();
        }
    }
    sendAddBreakpointFiles();
    sendStartSession();
}
Also used : AddBreakpointRequest(org.eclipse.che.plugin.zdb.server.connection.ZendDbgClientMessages.AddBreakpointRequest) AddBreakpointResponse(org.eclipse.che.plugin.zdb.server.connection.ZendDbgEngineMessages.AddBreakpointResponse)

Example 2 with AddBreakpointResponse

use of org.eclipse.che.plugin.zdb.server.connection.ZendDbgEngineMessages.AddBreakpointResponse in project che by eclipse.

the class ZendDebugger method sendAddBreakpoints.

private void sendAddBreakpoints(String remoteFilePath) {
    List<ZendDbgBreakpoint> fileBreakpoints = new ArrayList<>();
    for (ZendDbgBreakpoint dbgBreakpoint : breakpoints.values()) {
        if (dbgBreakpoint.getLocation().getResourcePath().equals(remoteFilePath)) {
            fileBreakpoints.add(dbgBreakpoint);
        }
    }
    for (ZendDbgBreakpoint dbgBreakpoint : fileBreakpoints) {
        AddBreakpointResponse response = debugConnection.sendRequest(new AddBreakpointRequest(1, 2, dbgBreakpoint.getLocation().getLineNumber(), remoteFilePath));
        if (isOK(response)) {
            // Breakpoint was successfully registered in active session, send breakpoint activated event
            breakpointIds.put(dbgBreakpoint, response.getBreakpointID());
            debugCallback.onEvent(new BreakpointActivatedEventImpl(dbgBreakpoint.getVfsBreakpoint()));
        }
    }
}
Also used : AddBreakpointRequest(org.eclipse.che.plugin.zdb.server.connection.ZendDbgClientMessages.AddBreakpointRequest) ArrayList(java.util.ArrayList) BreakpointActivatedEventImpl(org.eclipse.che.api.debug.shared.model.impl.event.BreakpointActivatedEventImpl) AddBreakpointResponse(org.eclipse.che.plugin.zdb.server.connection.ZendDbgEngineMessages.AddBreakpointResponse)

Example 3 with AddBreakpointResponse

use of org.eclipse.che.plugin.zdb.server.connection.ZendDbgEngineMessages.AddBreakpointResponse in project che by eclipse.

the class ZendDebugger method sendAddBreakpoint.

private void sendAddBreakpoint(ZendDbgBreakpoint dbgBreakpoint) {
    AddBreakpointResponse response = debugConnection.sendRequest(new AddBreakpointRequest(1, 2, dbgBreakpoint.getLocation().getLineNumber(), dbgBreakpoint.getLocation().getResourcePath()));
    if (isOK(response)) {
        // Breakpoint was successfully registered in active session, send breakpoint activated event
        breakpointIds.put(dbgBreakpoint, response.getBreakpointID());
        debugCallback.onEvent(new BreakpointActivatedEventImpl(dbgBreakpoint.getVfsBreakpoint()));
    }
}
Also used : AddBreakpointRequest(org.eclipse.che.plugin.zdb.server.connection.ZendDbgClientMessages.AddBreakpointRequest) BreakpointActivatedEventImpl(org.eclipse.che.api.debug.shared.model.impl.event.BreakpointActivatedEventImpl) AddBreakpointResponse(org.eclipse.che.plugin.zdb.server.connection.ZendDbgEngineMessages.AddBreakpointResponse)

Aggregations

AddBreakpointRequest (org.eclipse.che.plugin.zdb.server.connection.ZendDbgClientMessages.AddBreakpointRequest)3 AddBreakpointResponse (org.eclipse.che.plugin.zdb.server.connection.ZendDbgEngineMessages.AddBreakpointResponse)3 BreakpointActivatedEventImpl (org.eclipse.che.api.debug.shared.model.impl.event.BreakpointActivatedEventImpl)2 ArrayList (java.util.ArrayList)1