use of org.eclipse.che.api.debug.shared.model.Location in project che by eclipse.
the class NodeJsStepParserTest method testParse.
@Test
public void testParse() throws Exception {
NodeJsOutput nodeJsOutput = NodeJsOutput.of("break in module.js:559\n" + " 557 if (depth === 0) stat.cache = null;\n" + " 558 return result;\n" + ">559 };\n" + " 560 \n" + " 561");
Location location = parser.parse(nodeJsOutput);
assertEquals(location.getTarget(), "module.js");
assertEquals(location.getLineNumber(), 559);
}
use of org.eclipse.che.api.debug.shared.model.Location in project che by eclipse.
the class NodeJsBackTraceParserTest method testParse.
@Test(dataProvider = "parse")
public void testParse(String output, String script, int line) throws Exception {
NodeJsOutput nodeJsOutput = NodeJsOutput.of(output);
Location location = parser.parse(nodeJsOutput);
assertEquals(location.getTarget(), script);
assertEquals(location.getLineNumber(), line);
}
use of org.eclipse.che.api.debug.shared.model.Location in project che by eclipse.
the class DebuggerService method deleteBreakpoint.
@DELETE
@Path("{id}/breakpoint")
public void deleteBreakpoint(@PathParam("id") String sessionId, @QueryParam("target") String target, @QueryParam("line") @DefaultValue("0") int lineNumber) throws DebuggerException {
if (target == null) {
debuggerManager.getDebugger(sessionId).deleteAllBreakpoints();
} else {
Location location = new LocationImpl(target, lineNumber);
debuggerManager.getDebugger(sessionId).deleteBreakpoint(location);
}
}
use of org.eclipse.che.api.debug.shared.model.Location in project che by eclipse.
the class GdbRun method parse.
/**
* Factory method.
*/
public static GdbRun 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 GdbRun(new BreakpointImpl(location));
}
}
return new GdbRun(null);
}
use of org.eclipse.che.api.debug.shared.model.Location in project che by eclipse.
the class GdbDebuggerTest method addBreakpoint.
private void addBreakpoint() throws DebuggerException, InterruptedException {
Location location = new LocationImpl("h.cpp", 7);
Breakpoint breakpoint = new BreakpointImpl(location);
gdbDebugger.addBreakpoint(breakpoint);
assertEquals(events.size(), 1);
DebuggerEvent debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof BreakpointActivatedEvent);
BreakpointActivatedEvent breakpointActivatedEvent = (BreakpointActivatedEvent) debuggerEvent;
assertEquals(breakpointActivatedEvent.getBreakpoint().getLocation().getTarget(), "h.cpp");
assertEquals(breakpointActivatedEvent.getBreakpoint().getLocation().getLineNumber(), 7);
}
Aggregations