本文整理汇总了Java中com.sun.jdi.request.StepRequest类的典型用法代码示例。如果您正苦于以下问题:Java StepRequest类的具体用法?Java StepRequest怎么用?Java StepRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StepRequest类属于com.sun.jdi.request包,在下文中一共展示了StepRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: stepDone
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private void stepDone(EventRequest er) throws InternalExceptionWrapper, VMDisconnectedExceptionWrapper {
JPDAThreadImpl t;
if (er instanceof StepRequest) {
StepRequest sr = (StepRequest) er;
t = ((JPDADebuggerImpl) debugger).getThread(StepRequestWrapper.thread(sr));
} else {
ThreadReference tr = (ThreadReference) EventRequestWrapper.getProperty(er, "thread"); // NOI18N
if (tr != null) {
t = ((JPDADebuggerImpl) debugger).getThread(tr);
} else {
t = null;
}
}
if (t != null) {
t.setInStep(false, null);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:JPDAStepImpl.java
示例2: isSyntheticMethod
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
/**
* Test whether the method is considered to be synthetic
* @param m The method
* @param loc The current location in that method
* @return 0 when not synthetic
* positive when suggested step depth is returned
* negative when is synthetic and no further step depth is suggested.
*/
public static int isSyntheticMethod(Method m, Location loc) throws InternalExceptionWrapper, VMDisconnectedExceptionWrapper {
String name = TypeComponentWrapper.name(m);
if (name.startsWith("lambda$")) { // NOI18N
int lineNumber = LocationWrapper.lineNumber(loc);
if (lineNumber == 1) {
// We're in the initialization of the Lambda. We need to step over it.
return StepRequest.STEP_OVER;
}
return 0; // Do not treat Lambda methods as synthetic, because they contain user code.
} else {
// Do check the class for being Lambda synthetic class:
ReferenceType declaringType = LocationWrapper.declaringType(loc);
try {
String className = ReferenceTypeWrapper.name(declaringType);
if (className.contains("$$Lambda$")) { // NOI18N
// Lambda synthetic class
return -1;
}
} catch (ObjectCollectedExceptionWrapper ex) {
}
}
return TypeComponentWrapper.isSynthetic(m) ? -1 : 0;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:JPDAStepImpl.java
示例3: perform
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
@Override
public void perform(String[] argv, Context ctx) {
if (argv.length > 0) {
switch (argv[0]) {
case "into":
singleStep(ctx, StepRequest.STEP_INTO);
break;
case "out":
singleStep(ctx, StepRequest.STEP_OUT);
break;
case "over":
singleStep(ctx, StepRequest.STEP_OVER);
break;
case "check":
checkStep(ctx);
}
} else {
singleStep(ctx, StepRequest.STEP_OVER);
}
}
开发者ID:CvvT,项目名称:andbg,代码行数:21,代码来源:step.java
示例4: deleteStepRequests
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
void deleteStepRequests(@Nullable final ThreadReference stepThread) {
EventRequestManager requestManager = getVirtualMachineProxy().eventRequestManager();
List<StepRequest> stepRequests = requestManager.stepRequests();
if (!stepRequests.isEmpty()) {
final List<StepRequest> toDelete = new ArrayList<StepRequest>(stepRequests.size());
for (final StepRequest request : stepRequests) {
ThreadReference threadReference = request.thread();
// [jeka] on attempt to delete a request assigned to a thread with unknown status, a JDWP error occurs
try {
if (threadReference.status() != ThreadReference.THREAD_STATUS_UNKNOWN && (stepThread == null || stepThread.equals(threadReference))) {
toDelete.add(request);
}
}
catch (IllegalThreadStateException e) {
LOG.info(e); // undocumented by JDI: may be thrown when querying thread status
}
catch (ObjectCollectedException ignored) {
}
}
requestManager.deleteEventRequests(toDelete);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DebugProcessImpl.java
示例5: contextAction
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
@Override
public void contextAction() {
showStatusText(DebuggerBundle.message("status.step.over"));
final SuspendContextImpl suspendContext = getSuspendContext();
final ThreadReferenceProxyImpl stepThread = getContextThread();
// need this hint while stepping over for JSR45 support:
// several lines of generated java code may correspond to a single line in the source file,
// from which the java code was generated
RequestHint hint = new RequestHint(stepThread, suspendContext, StepRequest.STEP_OVER);
hint.setRestoreBreakpoints(myIsIgnoreBreakpoints);
hint.setIgnoreFilters(myIsIgnoreBreakpoints || mySession.shouldIgnoreSteppingFilters());
applyThreadFilter(stepThread);
final MethodReturnValueWatcher rvWatcher = myReturnValueWatcher;
if (rvWatcher != null) {
rvWatcher.enable(stepThread.getThreadReference());
}
doStep(suspendContext, stepThread, myStepSize, StepRequest.STEP_OVER, hint);
if (myIsIgnoreBreakpoints) {
DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager().disableBreakpoints(DebugProcessImpl.this);
}
super.contextAction();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:DebugProcessImpl.java
示例6: doStep
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private void doStep(int depth, SuspendPolicy suspendPolicy) throws DebuggerException {
lock.lock();
try {
clearSteps();
StepRequest request =
getEventManager().createStepRequest(getCurrentThread(), StepRequest.STEP_LINE, depth);
request.addCountFilter(1);
request.setSuspendPolicy(toSuspendEventRequest(suspendPolicy));
request.enable();
resume(newDto(ResumeActionDto.class));
} finally {
lock.unlock();
}
}
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:JavaDebugger.java
示例7: contextAction
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
public void contextAction() {
showStatusText(DebuggerBundle.message("status.step.into"));
final SuspendContextImpl suspendContext = getSuspendContext();
final ThreadReferenceProxyImpl stepThread = getContextThread();
final RequestHint hint = mySmartStepFilter != null?
new RequestHint(stepThread, suspendContext, mySmartStepFilter) :
new RequestHint(stepThread, suspendContext, StepRequest.STEP_INTO);
if (myForcedIgnoreFilters) {
try {
mySession.setIgnoreStepFiltersFlag(stepThread.frameCount());
}
catch (EvaluateException e) {
LOG.info(e);
}
}
hint.setIgnoreFilters(myForcedIgnoreFilters || mySession.shouldIgnoreSteppingFilters());
applyThreadFilter(stepThread);
doStep(suspendContext, stepThread, StepRequest.STEP_INTO, hint);
super.contextAction();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:DebugProcessImpl.java
示例8: createRequest
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
protected void createRequest()
{
final EventRequestManager manager = getEventRequestManager();
if (manager != null)
{
try
{
if (stepRequest != null)
{
removeRequest();
}
stepRequest = manager.createStepRequest(getUnderlyingThread(), StepRequest.STEP_LINE,
StepRequest.STEP_INTO);
final JiveDebugTarget target = (JiveDebugTarget) getDebugTarget();
final IModelFilter requestFilter = target.jdiManager().modelFilter();
requestFilter.filter(stepRequest);
stepRequest.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
stepRequest.enable();
addJDIEventListener(this, stepRequest);
}
catch (final RuntimeException e)
{
logError(e);
}
}
}
开发者ID:UBPL,项目名称:jive,代码行数:27,代码来源:JiveThread.java
示例9: run
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
final String run(String[] args) {
if (jdb.status != Status.STARTED) {
return String.format(NOT_VALID_UNTIL_STARTED, "stepi");
}
StepRequest request =
jdb.eventRequestManager.createStepRequest(jdb.thread,
StepRequest.STEP_MIN,
StepRequest.STEP_INTO);
request.addCountFilter(1);// next step only
request.enable();
return "Step one instruction.";
}
开发者ID:freeVM,项目名称:freeVM,代码行数:13,代码来源:Main.java
示例10: getJDIAction
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private static int getJDIAction (Object action) {
if (action == ActionsManager.ACTION_STEP_OUT)
return StepRequest.STEP_OUT;
if (action == ActionsManager.ACTION_STEP_OVER)
return StepRequest.STEP_OVER;
throw new IllegalArgumentException ();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:StepActionProvider.java
示例11: addPatternsToRequest
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private void addPatternsToRequest (String[] patterns, StepRequest stepRequest) throws InternalExceptionWrapper, VMDisconnectedExceptionWrapper {
if (stepRequest == null) return;
int i, k = patterns.length;
for (i = 0; i < k; i++) {
try {
StepRequestWrapper.addClassExclusionFilter(stepRequest, patterns [i]);
} catch (InvalidRequestStateException irex) {
// The request is gone - ignore
return ;
}
smartLogger.log(Level.FINER, " add pattern: {0}", patterns[i]);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:StepIntoNextMethod.java
示例12: unregister
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
/**
* Removes binding between the specified event request and a registered object.
*
* @param req request
* @see #register
*/
public synchronized void unregister (EventRequest req) throws InternalExceptionWrapper, VMDisconnectedExceptionWrapper {
Executor e = (Executor) EventRequestWrapper.getProperty(req, "executor");
EventRequestWrapper.putProperty (req, "executor", null); // NOI18N
if (e != null) {
e.removed(req);
}
if (req instanceof StepRequest) {
ThreadReference tr = StepRequestWrapper.thread((StepRequest) req);
debugger.getThread(tr).setInStep(false, null);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:Operator.java
示例13: setUpBoundaryStepRequest
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private boolean setUpBoundaryStepRequest(EventRequestManager erm,
ThreadReference trRef,
boolean isNextOperationFromDifferentExpression)
throws InternalExceptionWrapper, VMDisconnectedExceptionWrapper, ObjectCollectedExceptionWrapper {
boundaryStepRequest = EventRequestManagerWrapper.createStepRequest(
erm,
trRef,
StepRequest.STEP_LINE,
StepRequest.STEP_OVER
);
if (isNextOperationFromDifferentExpression) {
EventRequestWrapper.addCountFilter(boundaryStepRequest, 2);
} else {
EventRequestWrapper.addCountFilter(boundaryStepRequest, 1);
}
((JPDADebuggerImpl) debugger).getOperator().register(boundaryStepRequest, this);
EventRequestWrapper.setSuspendPolicy(boundaryStepRequest, debugger.getSuspend());
try {
EventRequestWrapper.enable (boundaryStepRequest);
requestsToCancel.add(boundaryStepRequest);
} catch (IllegalThreadStateException itsex) {
// the thread named in the request has died.
((JPDADebuggerImpl) debugger).getOperator().unregister(boundaryStepRequest);
boundaryStepRequest = null;
return false;
} catch (InvalidRequestStateExceptionWrapper ex) {
Exceptions.printStackTrace(ex);
((JPDADebuggerImpl) debugger).getOperator().unregister(boundaryStepRequest);
boundaryStepRequest = null;
return false;
}
return true;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:JPDAStepImpl.java
示例14: createStepRequest
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private static StepRequest createStepRequest(ThreadReference thread, int stepSize, int stepDepth, String[] stepFilters) {
StepRequest request = thread.virtualMachine().eventRequestManager().createStepRequest(thread, stepSize, stepDepth);
if (stepFilters != null) {
for (String stepFilter : stepFilters) {
request.addClassExclusionFilter(stepFilter);
}
}
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
request.addCountFilter(1);
return request;
}
开发者ID:Microsoft,项目名称:java-debug,代码行数:13,代码来源:DebugUtility.java
示例15: stepIntoThread
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private void stepIntoThread(ThreadReference thread) {
StepRequest request = DebugUtility.createStepIntoRequest(thread,
this.context.getStepFilters().classNameFilters);
currentDebugSession.getEventHub().stepEvents().filter(debugEvent -> request.equals(debugEvent.event.request()))
.take(1).subscribe(debugEvent -> {
debugEvent.shouldResume = false;
// Have to send to events to keep the UI sync with the step in operations:
context.getProtocolServer().sendEvent(new Events.StoppedEvent("step", thread.uniqueID()));
context.getProtocolServer().sendEvent(new Events.ContinuedEvent(thread.uniqueID()));
});
request.enable();
thread.resume();
}
开发者ID:Microsoft,项目名称:java-debug,代码行数:14,代码来源:JavaHotCodeReplaceProvider.java
示例16: clearSteps
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private void clearSteps() throws DebuggerException {
List<StepRequest> snapshot = new ArrayList<>(getEventManager().stepRequests());
for (StepRequest stepRequest : snapshot) {
if (stepRequest.thread().equals(getCurrentThread())) {
getEventManager().deleteEventRequest(stepRequest);
}
}
}
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:JavaDebugger.java
示例17: wrapStepRequests
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
public static List<StepRequest> wrapStepRequests(
F3VirtualMachine f3vm, List<StepRequest> reqs) {
if (reqs == null) {
return null;
}
List<StepRequest> result = new ArrayList<StepRequest>();
for (StepRequest req : reqs) {
result.add(wrap(f3vm, req));
}
return result;
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:12,代码来源:F3EventRequest.java
示例18: doStep
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
private StepEvent doStep(ThreadReference thread, int gran, int depth) {
final StepRequest sr =
eventRequestManager().createStepRequest(thread, gran, depth);
sr.addClassExclusionFilter("java.*");
sr.addClassExclusionFilter("sun.*");
sr.addClassExclusionFilter("com.sun.*");
sr.addCountFilter(1);
sr.enable();
StepEvent retEvent = (StepEvent)resumeToEvent(sr);
eventRequestManager().deleteEventRequest(sr);
return retEvent;
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:13,代码来源:Debugger.java
示例19: next
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
public boolean next() {
StepRequest req = evaluator.commandNext(false);
if (req != null) {
resumeToEvent(req);
return true;
} else {
return false;
}
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:10,代码来源:Debugger.java
示例20: step
import com.sun.jdi.request.StepRequest; //导入依赖的package包/类
public boolean step(String command) {
StepRequest req = evaluator.commandStep(new StringTokenizer(command), false);
if (req != null) {
resumeToEvent(req);
return true;
} else {
return false;
}
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:10,代码来源:Debugger.java
注:本文中的com.sun.jdi.request.StepRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论