use of org.eclipse.che.plugin.gdb.server.exception.GdbParseException 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);
}
use of org.eclipse.che.plugin.gdb.server.exception.GdbParseException in project che by eclipse.
the class GdbInfoProgram method parse.
/**
* Factory method.
*/
public static GdbInfoProgram parse(GdbOutput gdbOutput) throws GdbParseException {
String output = gdbOutput.getOutput();
Matcher matcher = GDB_PROGRAM_FINISHED.matcher(output);
if (matcher.find()) {
return new GdbInfoProgram(null);
}
matcher = GDB_PROGRAM_STOPPED.matcher(output);
if (matcher.find()) {
String address = matcher.group(1);
return new GdbInfoProgram(address);
}
throw new GdbParseException(GdbInfoProgram.class, output);
}
Aggregations