use of com.sun.jdi.VMCannotBeModifiedException in project che by eclipse.
the class JavaDebugger method resume.
@Override
public void resume(ResumeAction action) throws DebuggerException {
lock.lock();
try {
invalidateCurrentThread();
vm.resume();
LOG.debug("Resume VM");
} catch (VMCannotBeModifiedException e) {
throw new DebuggerException(e.getMessage(), e);
} finally {
lock.unlock();
}
}
use of com.sun.jdi.VMCannotBeModifiedException in project che by eclipse.
the class JavaDebugger method getAllBreakpoints.
@Override
public List<Breakpoint> getAllBreakpoints() throws DebuggerException {
List<BreakpointRequest> breakpointRequests;
try {
breakpointRequests = getEventManager().breakpointRequests();
} catch (DebuggerException e) {
Throwable cause = e.getCause();
if (cause instanceof VMCannotBeModifiedException) {
// If target VM in read-only state then list of break point always empty.
return Collections.emptyList();
}
throw e;
}
List<Breakpoint> breakPoints = new ArrayList<>(breakpointRequests.size());
for (BreakpointRequest breakpointRequest : breakpointRequests) {
com.sun.jdi.Location location = breakpointRequest.location();
// Breakpoint always enabled at the moment. Managing states of breakpoint is not supported for now.
breakPoints.add(newDto(BreakpointDto.class).withEnabled(true).withLocation(newDto(LocationDto.class).withTarget(location.declaringType().name()).withLineNumber(location.lineNumber())));
}
Collections.sort(breakPoints, BREAKPOINT_COMPARATOR);
return breakPoints;
}
Aggregations