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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations