Search in sources :

Example 21 with LocationImpl

use of org.eclipse.che.api.debug.shared.model.impl.LocationImpl in project che by eclipse.

the class GdbContinue method parse.

/**
     * Factory method.
     */
public static GdbContinue parse(GdbOutput gdbOutput) throws GdbParseException {
    String output = gdbOutput.getOutput();
    for (String line : output.split("\n")) {
        Matcher matcher = GDB_BREAKPOINT.matcher(line);
        if (matcher.find()) {
            String file = matcher.group(1);
            String lineNumber = matcher.group(2);
            Location location = new LocationImpl(file, Integer.parseInt(lineNumber));
            return new GdbContinue(new BreakpointImpl(location));
        }
    }
    return new GdbContinue(null);
}
Also used : BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) Matcher(java.util.regex.Matcher) LocationImpl(org.eclipse.che.api.debug.shared.model.impl.LocationImpl) Location(org.eclipse.che.api.debug.shared.model.Location)

Example 22 with LocationImpl

use of org.eclipse.che.api.debug.shared.model.impl.LocationImpl in project che by eclipse.

the class GdbInfoLine method parse.

/**
     * Factory method.
     */
public static GdbInfoLine parse(GdbOutput gdbOutput) throws GdbParseException {
    String output = gdbOutput.getOutput();
    Matcher matcher = GDB_INFO_LINE.matcher(output);
    if (matcher.find()) {
        String lineNumber = matcher.group(1);
        String file = matcher.group(2);
        return new GdbInfoLine(new LocationImpl(file, Integer.parseInt(lineNumber)));
    }
    matcher = GDB_LINE_OUT_OF_RANGE.matcher(output);
    if (matcher.find()) {
        String lineNumber = matcher.group(1);
        String file = matcher.group(2);
        return new GdbInfoLine(new LocationImpl(file, Integer.parseInt(lineNumber)));
    }
    throw new GdbParseException(GdbInfoLine.class, output);
}
Also used : Matcher(java.util.regex.Matcher) LocationImpl(org.eclipse.che.api.debug.shared.model.impl.LocationImpl) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Aggregations

LocationImpl (org.eclipse.che.api.debug.shared.model.impl.LocationImpl)22 Location (org.eclipse.che.api.debug.shared.model.Location)11 BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)11 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)8 Matcher (java.util.regex.Matcher)7 Test (org.testng.annotations.Test)7 BreakpointActivatedEvent (org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent)6 DebuggerEvent (org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)5 NodeJsDebuggerParseException (org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerParseException)3 ArrayList (java.util.ArrayList)2 SuspendEvent (org.eclipse.che.api.debug.shared.model.event.SuspendEvent)2 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)2 GdbParseException (org.eclipse.che.plugin.gdb.server.exception.GdbParseException)2 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 HashMap (java.util.HashMap)1 DELETE (javax.ws.rs.DELETE)1 Path (javax.ws.rs.Path)1 VariablePath (org.eclipse.che.api.debug.shared.model.VariablePath)1