use of org.eclipse.che.plugin.gdb.server.parser.GdbVersion in project che by eclipse.
the class GdbDebugger method init.
private static GdbDebugger init(String host, int port, String file, String srcDirectory, DebuggerCallback debuggerCallback) throws DebuggerException {
Gdb gdb;
try {
gdb = Gdb.start();
} catch (IOException e) {
throw new DebuggerException("Can't start GDB: " + e.getMessage(), e);
}
try {
GdbDirectory directory = gdb.directory(srcDirectory);
LOG.debug("Source directories: " + directory.getDirectories());
gdb.file(file);
if (port > 0) {
gdb.targetRemote(host, port);
}
} catch (DebuggerException | IOException | InterruptedException e) {
gdb.stop();
throw new DebuggerException("Can't initialize GDB: " + e.getMessage(), e);
}
GdbVersion gdbVersion = gdb.getGdbVersion();
return new GdbDebugger(host, port, gdbVersion.getVersion(), gdbVersion.getName(), file, gdb, debuggerCallback);
}
Aggregations