use of org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl in project che by eclipse.
the class JavaDebugger method processStepEvent.
private boolean processStepEvent(com.sun.jdi.event.StepEvent event) throws DebuggerException {
setCurrentThread(event.thread());
com.sun.jdi.Location jdiLocation = event.location();
Location location = debuggerUtil.getLocation(jdiLocation);
debuggerCallback.onEvent(new SuspendEventImpl(location));
return false;
}
use of org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl in project che by eclipse.
the class NodeJsDebugger method onOutputProduced.
@Override
public boolean onOutputProduced(NodeJsOutput nodeJsOutput) throws NodeJsDebuggerException {
if (NodeJsStepParser.INSTANCE.match(nodeJsOutput)) {
SuspendEventImpl suspendEvent = new SuspendEventImpl(NodeJsStepParser.INSTANCE.parse(nodeJsOutput));
debuggerCallback.onEvent(suspendEvent);
} else if (NodeJsBackTraceParser.INSTANCE.match(nodeJsOutput)) {
SuspendEventImpl suspendEvent = new SuspendEventImpl(NodeJsBackTraceParser.INSTANCE.parse(nodeJsOutput));
debuggerCallback.onEvent(suspendEvent);
} else if (DEBUG_TIMED_OUT_MSG.equals(nodeJsOutput.getOutput())) {
disconnect();
} else {
return false;
}
return true;
}
use of org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl in project che by eclipse.
the class JavaDebugger method processBreakPointEvent.
private boolean processBreakPointEvent(com.sun.jdi.event.BreakpointEvent event) throws DebuggerException {
setCurrentThread(event.thread());
boolean hitBreakpoint;
ExpressionParser parser = (ExpressionParser) event.request().getProperty("org.eclipse.che.ide.java.debug.condition.expression.parser");
if (parser != null) {
com.sun.jdi.Value result = evaluate(parser);
hitBreakpoint = result instanceof com.sun.jdi.BooleanValue && ((com.sun.jdi.BooleanValue) result).value();
} else {
// If there is no expression.
hitBreakpoint = true;
}
if (hitBreakpoint) {
com.sun.jdi.Location jdiLocation = event.location();
Location location;
try {
location = debuggerUtil.getLocation(jdiLocation);
} catch (DebuggerException e) {
location = new LocationImpl(jdiLocation.declaringType().name(), jdiLocation.lineNumber());
}
debuggerCallback.onEvent(new SuspendEventImpl(location));
}
// or if condition expression is not set.
return !hitBreakpoint;
}
use of org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl in project che by eclipse.
the class GdbDebugger method stepOver.
@Override
public void stepOver(StepOverAction action) throws DebuggerException {
try {
GdbInfoLine gdbInfoLine = gdb.next();
if (gdbInfoLine == null) {
disconnect();
return;
}
currentLocation = gdbInfoLine.getLocation();
debuggerCallback.onEvent(new SuspendEventImpl(gdbInfoLine.getLocation()));
} catch (GdbTerminatedException e) {
disconnect();
throw e;
} catch (IOException | GdbParseException | InterruptedException e) {
throw new DebuggerException("Step into error. " + e.getMessage(), e);
}
}
use of org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl in project che by eclipse.
the class GdbDebugger method suspend.
@Override
public void suspend() throws DebuggerException {
try {
currentLocation = gdb.suspend(file, isRemoteConnection());
debuggerCallback.onEvent(new SuspendEventImpl(currentLocation));
} catch (IOException | InterruptedException e) {
throw new DebuggerException("Can not suspend debugger session. " + e.getMessage(), e);
}
}
Aggregations