Search in sources :

Example 1 with GdbDirectory

use of org.eclipse.che.plugin.gdb.server.parser.GdbDirectory 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);
}
Also used : GdbDirectory(org.eclipse.che.plugin.gdb.server.parser.GdbDirectory) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) GdbVersion(org.eclipse.che.plugin.gdb.server.parser.GdbVersion) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)1 GdbDirectory (org.eclipse.che.plugin.gdb.server.parser.GdbDirectory)1 GdbVersion (org.eclipse.che.plugin.gdb.server.parser.GdbVersion)1