本文整理汇总了Java中com.sun.jdi.request.EventRequest.SUSPEND_NONE属性的典型用法代码示例。如果您正苦于以下问题:Java EventRequest.SUSPEND_NONE属性的具体用法?Java EventRequest.SUSPEND_NONE怎么用?Java EventRequest.SUSPEND_NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.jdi.request.EventRequest
的用法示例。
在下文中一共展示了EventRequest.SUSPEND_NONE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resume
public void resume() {
switch (suspendPolicy()) {
case EventRequest.SUSPEND_ALL:
vm.resume();
break;
case EventRequest.SUSPEND_EVENT_THREAD:
ThreadReference thread = eventThread();
if (thread == null) {
throw new InternalException("Inconsistent suspend policy");
}
thread.resume();
break;
case EventRequest.SUSPEND_NONE:
// Do nothing
break;
default:
throw new InternalException("Invalid suspend policy");
}
}
示例2: JDWPtoJDISuspendPolicy
static int JDWPtoJDISuspendPolicy(byte jdwpPolicy) {
switch(jdwpPolicy) {
case JDWP.SuspendPolicy.ALL:
return EventRequest.SUSPEND_ALL;
case JDWP.SuspendPolicy.EVENT_THREAD:
return EventRequest.SUSPEND_EVENT_THREAD;
case JDWP.SuspendPolicy.NONE:
return EventRequest.SUSPEND_NONE;
default:
throw new IllegalArgumentException("Illegal policy constant: " + jdwpPolicy);
}
}
示例3: JDItoJDWPSuspendPolicy
static byte JDItoJDWPSuspendPolicy(int jdiPolicy) {
switch(jdiPolicy) {
case EventRequest.SUSPEND_ALL:
return JDWP.SuspendPolicy.ALL;
case EventRequest.SUSPEND_EVENT_THREAD:
return JDWP.SuspendPolicy.EVENT_THREAD;
case EventRequest.SUSPEND_NONE:
return JDWP.SuspendPolicy.NONE;
default:
throw new IllegalArgumentException("Illegal policy constant: " + jdiPolicy);
}
}
示例4: toSuspendPolicy
private SuspendPolicy toSuspendPolicy(int suspendEventRequest) {
switch (suspendEventRequest) {
case EventRequest.SUSPEND_EVENT_THREAD:
return SuspendPolicy.THREAD;
case EventRequest.SUSPEND_NONE:
return SuspendPolicy.NONE;
default:
return SuspendPolicy.ALL;
}
}
示例5: toSuspendEventRequest
private int toSuspendEventRequest(SuspendPolicy suspendPolicy) {
if (suspendPolicy == null) {
return EventRequest.SUSPEND_ALL;
}
switch (suspendPolicy) {
case NONE:
return EventRequest.SUSPEND_NONE;
case THREAD:
return EventRequest.SUSPEND_EVENT_THREAD;
default:
return EventRequest.SUSPEND_ALL;
}
}
示例6: pushSuspendContext
@Override
public SuspendContextImpl pushSuspendContext(@MagicConstant(flagsFromClass = EventRequest.class) final int suspendPolicy, int nVotes) {
SuspendContextImpl suspendContext = new SuspendContextImpl(myDebugProcess, suspendPolicy, nVotes, null) {
@Override
protected void resumeImpl() {
if (LOG.isDebugEnabled()) {
LOG.debug("Start resuming...");
}
myDebugProcess.logThreads();
switch(getSuspendPolicy()) {
case EventRequest.SUSPEND_ALL:
int resumeAttempts = 5;
while (--resumeAttempts > 0) {
try {
myDebugProcess.getVirtualMachineProxy().resume();
break;
}
catch (InternalException e) {
//InternalException 13 means that there are running threads that we are trying to resume
//On MacOS it happened that native thread didn't stop while some java thread reached breakpoint
//noinspection StatementWithEmptyBody
if (/*Patches.MAC_RESUME_VM_HACK && */e.errorCode() == 13) {
//Its funny, but second resume solves the problem
}
else {
LOG.error(e);
break;
}
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("VM resumed ");
}
break;
case EventRequest.SUSPEND_EVENT_THREAD:
myFrozenThreads.remove(getThread());
getThread().resume();
if(LOG.isDebugEnabled()) {
LOG.debug("Thread resumed : " + getThread().toString());
}
break;
case EventRequest.SUSPEND_NONE:
if (LOG.isDebugEnabled()) {
LOG.debug("None resumed");
}
break;
}
if (LOG.isDebugEnabled()) {
LOG.debug("Suspends = " + suspends);
}
myDebugProcess.logThreads();
}
};
pushContext(suspendContext);
return suspendContext;
}
示例7: pushSuspendContext
public SuspendContextImpl pushSuspendContext(final int suspendPolicy, int nVotes) {
SuspendContextImpl suspendContext = new SuspendContextImpl(myDebugProcess, suspendPolicy, nVotes, null) {
protected void resumeImpl() {
if (LOG.isDebugEnabled()) {
LOG.debug("Start resuming...");
}
myDebugProcess.logThreads();
switch(getSuspendPolicy()) {
case EventRequest.SUSPEND_ALL:
int resumeAttempts = 5;
while (--resumeAttempts > 0) {
try {
myDebugProcess.getVirtualMachineProxy().resume();
break;
}
catch (InternalException e) {
//InternalException 13 means that there are running threads that we are trying to resume
//On MacOS it happened that native thread didn't stop while some java thread reached breakpoint
if (/*Patches.MAC_RESUME_VM_HACK && */e.errorCode() == 13) {
//Its funny, but second resume solves the problem
continue;
}
else {
LOG.error(e);
break;
}
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("VM resumed ");
}
break;
case EventRequest.SUSPEND_EVENT_THREAD:
getThread().resume();
if(LOG.isDebugEnabled()) {
LOG.debug("Thread resumed : " + getThread().toString());
}
break;
case EventRequest.SUSPEND_NONE:
if (LOG.isDebugEnabled()) {
LOG.debug("None resumed");
}
break;
}
if (LOG.isDebugEnabled()) {
LOG.debug("Suspends = " + suspends);
}
myDebugProcess.logThreads();
}
};
pushContext(suspendContext);
return suspendContext;
}