private void disableEventRequest() { List<BreakpointRequest> breakpoint = threadRef.virtualMachine().eventRequestManager().breakpointRequests(); for (int j = 0; j < breakpoint.size(); j++) { BreakpointRequest breakpointRequest = breakpoint.get(j); breakpointRequest.setEnabled(false); } }
.map(request -> ((BreakpointRequest) request).location()).toList().subscribe(list -> { existingLocations.addAll(list); }); try { BreakpointRequest request = vm.eventRequestManager().createBreakpointRequest(location); request.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD); if (hitCount > 0) { request.addCountFilter(hitCount); request.enable(); newRequests.add(request); } catch (VMDisconnectedException ex) {
private void installHaltPoint(VirtualMachine vm) { List<ReferenceType> targetClasses = vm .classesByName(VMLocalTarget.class.getName()); ReferenceType classRef = targetClasses.get(0); Method meth = classRef.methodsByName("haltPoint").get(0); BreakpointRequest req = vm.eventRequestManager() .createBreakpointRequest(meth.location()); req.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD); req.enable(); }
if (location.equals(breakpointRequest.location())) { LOG.debug("Breakpoint at {} already set", location); return; request.setSuspendPolicy(toSuspendEventRequest(conf.getSuspendPolicy())); } else { request.setSuspendPolicy(EventRequest.SUSPEND_ALL); && !conf.getCondition().isEmpty()) { ExpressionParser parser = ExpressionParser.newInstance(conf.getCondition()); request.putProperty("org.eclipse.che.ide.java.debug.condition.expression.parser", parser); request.addCountFilter(conf.getHitCount()); request.setEnabled(true); } catch (NativeMethodException | IllegalThreadStateException | InvalidRequestStateException e) { throw new DebuggerException(e.getMessage(), e);
req.setEnabled( false ); Location location = req.location(); Breakpoint breakpoint = _bpm.findBreakpoint( location.declaringType().name().replace( '$', '.' ), location.lineNumber() ); req.setEnabled( breakpoint.isActive() );
req.putProperty( TEMPORARY, bp.isTemporary() ); req.setEnabled( bp.isActive() && (bp.isActiveWhenMuted() || !_bpm.isMuted()) );
@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 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(asDto(new JdbLocation(languageServer, location)))); } breakPoints.sort(BREAKPOINT_COMPARATOR); return breakPoints; }
@Override public void deleteBreakpoint(Location location) throws DebuggerException { final String target = location.getTarget(); final String className = !target.endsWith(".java") ? target : languageServer.identifyFqnInResource(location.getTarget(), location.getLineNumber()); final int lineNumber = location.getLineNumber(); EventRequestManager requestManager = getEventManager(); List<BreakpointRequest> snapshot = new ArrayList<>(requestManager.breakpointRequests()); for (BreakpointRequest breakpointRequest : snapshot) { com.sun.jdi.Location jdiLocation = breakpointRequest.location(); if (jdiLocation.declaringType().name().equals(className) && jdiLocation.lineNumber() == lineNumber) { requestManager.deleteEventRequest(breakpointRequest); LOG.debug("Delete breakpoint: {}", location); } } List<Breakpoint> defferedByClass = deferredBreakpoints.get(className); if (defferedByClass != null) { defferedByClass.removeIf( breakpoint -> { Location l = breakpoint.getLocation(); return l.getLineNumber() == location.getLineNumber() && l.getTarget().equals(location.getTarget()); }); } }
private void enableEventRequest() { List<BreakpointRequest> breakpoint = threadRef.virtualMachine().eventRequestManager().breakpointRequests(); for (int j = 0; j < breakpoint.size(); j++) { BreakpointRequest breakpointRequest = breakpoint.get(j); breakpointRequest.setEnabled(true); } }
Location location = req.location(); if( getOutermostType( location.declaringType() ).equals( bp.getFqn() ) && location.lineNumber() == bp.getLine() )
private void processBreakPointEvents(BreakpointEvent breakpointEvent) throws IncompatibleThreadStateException { if (jumpEnabled) { breakpointJump.setEnabled(false); jumpEnabled = false; breakpointSuspicious.setEnabled(true); return;
for( BreakpointRequest req : bpRequests ) Location location = req.location(); if( getOutermostType( location.declaringType() ).equals( bp.getFqn() ) && location.lineNumber() == bp.getLine() )
private void processClassPrepareEvent() throws AbsentInformationException { EventRequestManager erm = vm.eventRequestManager(); List<ReferenceType> referenceTypes = vm.classesByName(this.location.getContainingClassName()); List listOfLocations = referenceTypes.get(0).locationsOfLine(this.location.getLineNumber()); if (listOfLocations.size() == 0) { throw new RuntimeException("Buggy class not found " + this.location); } com.sun.jdi.Location jdiLocation = (com.sun.jdi.Location) listOfLocations.get(0); this.buggyMethod = jdiLocation.method().name(); breakpointSuspicious = erm.createBreakpointRequest(jdiLocation); breakpointSuspicious.setEnabled(true); initSpoon(); this.initExecutionTime = System.currentTimeMillis(); }
private void processClassPrepareEvent() throws AbsentInformationException { EventRequestManager erm = vm.eventRequestManager(); List<ReferenceType> referenceTypes = vm.classesByName(this.location.getContainingClassName()); // List listOfLocations = // referenceTypes.get(0).locationsOfLine(this.location.getLineNumber()); int loc = this.location.getLineNumber(); List listOfLocations = null; do { listOfLocations = referenceTypes.get(0).locationsOfLine(loc); loc--; } while (loc > 0 && listOfLocations.isEmpty()); if (listOfLocations.size() == 0) { throw new RuntimeException("Buggy class not found " + this.location); } com.sun.jdi.Location jdiLocation = (com.sun.jdi.Location) listOfLocations.get(0); this.buggyMethod = jdiLocation.method().name(); breakpointSuspicious = erm.createBreakpointRequest(jdiLocation); breakpointSuspicious.setEnabled(true); initSpoon(); this.initExecutionTime = System.currentTimeMillis(); }
private void processBreakPointEvents(BreakpointEvent breakpointEvent) throws IncompatibleThreadStateException { if (jumpEnabled) { breakpointJump.setEnabled(false); jumpEnabled = false; breakpointSuspicious.setEnabled(true); return;
breakpointJump.setEnabled(true); jumpEnabled = true; breakpointSuspicious.setEnabled(false); return; } catch (AbsentInformationException e) {
breakpointJump.setEnabled(true); jumpEnabled = true; breakpointSuspicious.setEnabled(false); return; } catch (AbsentInformationException e) {