use of org.eclipse.che.plugin.gdb.server.parser.GdbPrint 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.parser.GdbPrint in project che by eclipse.
the class GdbTest method testVariables.
@Test
public void testVariables() throws Exception {
gdb.file(file);
gdb.breakpoint(7);
gdb.run();
GdbPrint gdbPrint = gdb.print("i");
assertEquals(gdbPrint.getValue(), "0");
gdb.setVar("i", "1");
gdbPrint = gdb.print("i");
assertEquals(gdbPrint.getValue(), "1");
GdbPType gdbPType = gdb.ptype("i");
assertEquals(gdbPType.getType(), "int");
}
Aggregations