Search in sources :

Example 11 with GdbParseException

use of org.eclipse.che.plugin.gdb.server.exception.GdbParseException in project che by eclipse.

the class GdbPrint method parse.

/**
     * Factory method.
     */
public static GdbPrint parse(GdbOutput gdbOutput) throws GdbParseException {
    String output = gdbOutput.getOutput();
    Matcher matcher = GDB_PRINT.matcher(output);
    if (matcher.find()) {
        String value = matcher.group(2);
        return new GdbPrint(value);
    }
    throw new GdbParseException(GdbPrint.class, output);
}
Also used : Matcher(java.util.regex.Matcher) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Example 12 with GdbParseException

use of org.eclipse.che.plugin.gdb.server.exception.GdbParseException in project che by eclipse.

the class ProcessInfo method parse.

/**
     * Factory method.
     */
public static ProcessInfo parse(String output) throws GdbParseException {
    final Matcher matcher = PROCESS_INFO.matcher(output);
    if (matcher.find()) {
        try {
            final int processId = Integer.parseInt(matcher.group(1));
            final String processName = matcher.group(2).replaceAll("\\s+", "");
            return new ProcessInfo(processName, processId);
        } catch (NumberFormatException e) {
            throw new GdbParseException(ProcessInfo.class, output);
        }
    }
    throw new GdbParseException(ProcessInfo.class, output);
}
Also used : Matcher(java.util.regex.Matcher) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Example 13 with GdbParseException

use of org.eclipse.che.plugin.gdb.server.exception.GdbParseException in project che by eclipse.

the class GdbDelete method parse.

/**
     * Factory method.
     */
public static GdbDelete parse(GdbOutput gdbOutput) throws GdbParseException {
    String output = gdbOutput.getOutput();
    Matcher matcher = GDB_DELETE.matcher(output);
    if (matcher.find()) {
        return new GdbDelete();
    }
    throw new GdbParseException(GdbDelete.class, output);
}
Also used : Matcher(java.util.regex.Matcher) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Example 14 with GdbParseException

use of org.eclipse.che.plugin.gdb.server.exception.GdbParseException in project che by eclipse.

the class GdbDirectory method parse.

/**
     * Factory method.
     */
public static GdbDirectory parse(GdbOutput gdbOutput) throws GdbParseException {
    String output = gdbOutput.getOutput();
    Matcher matcher = GDB_DIRECTORY.matcher(output);
    if (matcher.find()) {
        String directory = matcher.group(1);
        return new GdbDirectory(directory);
    }
    throw new GdbParseException(GdbDirectory.class, output);
}
Also used : Matcher(java.util.regex.Matcher) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Example 15 with GdbParseException

use of org.eclipse.che.plugin.gdb.server.exception.GdbParseException in project che by eclipse.

the class GdbTargetRemote method parse.

/**
     * Factory method.
     */
public static GdbTargetRemote parse(GdbOutput gdbOutput) throws GdbParseException, DebuggerException {
    String output = gdbOutput.getOutput();
    Matcher matcher = GDB_TARGET_REMOTE.matcher(output);
    if (matcher.find()) {
        String host = matcher.group(1);
        String port = matcher.group(2);
        return new GdbTargetRemote(host, port);
    } else if (CONNECTION_TIMED_OUT.matcher(output).find()) {
        throw new DebuggerException(output);
    }
    throw new GdbParseException(GdbTargetRemote.class, output);
}
Also used : Matcher(java.util.regex.Matcher) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Aggregations

GdbParseException (org.eclipse.che.plugin.gdb.server.exception.GdbParseException)22 Matcher (java.util.regex.Matcher)13 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)10 IOException (java.io.IOException)9 GdbTerminatedException (org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException)9 SuspendEventImpl (org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl)5 GdbInfoLine (org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine)3 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)2 Location (org.eclipse.che.api.debug.shared.model.Location)2 LocationImpl (org.eclipse.che.api.debug.shared.model.impl.LocationImpl)2 GdbContinue (org.eclipse.che.plugin.gdb.server.parser.GdbContinue)2 GdbInfoProgram (org.eclipse.che.plugin.gdb.server.parser.GdbInfoProgram)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Variable (org.eclipse.che.api.debug.shared.model.Variable)1 VariablePath (org.eclipse.che.api.debug.shared.model.VariablePath)1 SimpleValueImpl (org.eclipse.che.api.debug.shared.model.impl.SimpleValueImpl)1 StackFrameDumpImpl (org.eclipse.che.api.debug.shared.model.impl.StackFrameDumpImpl)1 VariableImpl (org.eclipse.che.api.debug.shared.model.impl.VariableImpl)1