private void disableStepRequests(JPDAThread thread) { ThreadReference tr; try { tr = (ThreadReference) thread.getClass().getMethod("getThreadReference").invoke(thread); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException ex) { Exceptions.printStackTrace(ex); return ; } try { VirtualMachine vm = tr.virtualMachine(); if (vm == null) return; EventRequestManager erm = vm.eventRequestManager(); List<StepRequest> l = erm.stepRequests(); for (StepRequest stepRequest : l) { if (stepRequest.thread().equals(tr)) { try { stepRequest.disable(); } catch (InvalidRequestStateException ex) {} } } } catch (VMDisconnectedException | InternalException | IllegalThreadStateException | InvalidRequestStateException e) { } }
private void clearSteps() throws DebuggerException { List<StepRequest> snapshot = new ArrayList<>(getEventManager().stepRequests()); for (StepRequest stepRequest : snapshot) { if (stepRequest.thread().equals(getCurrentThread())) { getEventManager().deleteEventRequest(stepRequest); } } }
private StepRequest createStep( ThreadReference eventThread, int depth ) { if( getEventRequestManager().stepRequests().size() > 0 ) { // Only one at a time return null; } StepRequest req = getEventRequestManager().createStepRequest( eventThread, StepRequest.STEP_LINE, depth ); req.addClassExclusionFilter( "sun.*" ); req.addClassExclusionFilter( "com.sun.*" ); //req.addClassExclusionFilter( "java.*" ); // we support dependency source now for java runtime debugging now req.addClassExclusionFilter( "gw.*" ); req.addCountFilter( 1 ); req.putProperty( FROM_LOCATION, _location ); req.enable(); return req; }
private void consumeRemainingEvents() { while( _eventIterator.hasNext() ) { Event event = _eventIterator.next(); if( event instanceof StepEvent ) { // a pending step event is superceded by a breakpoint or exception event getEventRequestManager().deleteEventRequest( event.request() ); } } // delete any pending step requests getEventRequestManager().deleteEventRequests( getEventRequestManager().stepRequests() ); }