use of org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException in project che by eclipse.
the class GdbDebugger method stepInto.
@Override
public void stepInto(StepIntoAction action) throws DebuggerException {
try {
GdbInfoLine gdbInfoLine = gdb.step();
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.plugin.gdb.server.exception.GdbTerminatedException in project che by eclipse.
the class GdbDebugger method getValue.
@Override
public SimpleValue getValue(VariablePath variablePath) throws DebuggerException {
try {
List<String> path = variablePath.getPath();
if (path.isEmpty()) {
throw new DebuggerException("Variable path is empty");
}
GdbPrint gdbPrint = gdb.print(path.get(0));
return new SimpleValueImpl(Collections.emptyList(), gdbPrint.getValue());
} catch (GdbTerminatedException e) {
disconnect();
throw e;
} catch (IOException | GdbParseException | InterruptedException e) {
throw new DebuggerException("Can't get value for " + variablePath + ". " + e.getMessage(), e);
}
}
use of org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException in project che by eclipse.
the class Gdb method grabGdbOutput.
private GdbOutput grabGdbOutput() throws InterruptedException, GdbTerminatedException {
GdbOutput gdbOutput = outputs.take();
if (gdbOutput.isTerminated()) {
String errorMsg = "GDB has been terminated with output: " + gdbOutput.getOutput();
LOG.error(errorMsg);
throw new GdbTerminatedException(errorMsg);
}
return gdbOutput;
}
use of org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException in project che by eclipse.
the class GdbDebugger method addBreakpoint.
@Override
public void addBreakpoint(Breakpoint breakpoint) throws DebuggerException {
try {
Location location = breakpoint.getLocation();
if (location.getTarget() == null) {
gdb.breakpoint(location.getLineNumber());
} else {
gdb.breakpoint(location.getTarget(), location.getLineNumber());
}
debuggerCallback.onEvent(new BreakpointActivatedEventImpl(breakpoint));
} catch (GdbTerminatedException e) {
disconnect();
throw e;
} catch (IOException | GdbParseException | InterruptedException e) {
throw new DebuggerException("Can't add breakpoint: " + breakpoint + ". " + e.getMessage(), e);
}
}
use of org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException 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);
}
}
Aggregations