本文整理汇总了Java中com.sun.jdi.event.StepEvent类的典型用法代码示例。如果您正苦于以下问题:Java StepEvent类的具体用法?Java StepEvent怎么用?Java StepEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StepEvent类属于com.sun.jdi.event包,在下文中一共展示了StepEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: singleStep
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
private void singleStep(final Context ctx, int depth) {
if (ctx.getState().isSuspend()) {
ctx.registerStep(ctx.getState().thread, depth, 1, new EventCallback() {
@Override
public void handleEvent(Event event) {
StepEvent se = (StepEvent) event;
SuspendState state = ctx.getState();
state.isSuspend = true;
state.thread = se.thread();
state.location = se.location();
util.Logger("single step complete");
}
});
ctx.getState().resume();
} else {
System.err.println("suspend thread before step");
}
}
示例2: wrap
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
public static F3Event wrap(F3VirtualMachine f3vm, Event evt) {
if (evt == null) {
return null;
}
if (evt instanceof AccessWatchpointEvent) {
return new F3AccessWatchpointEvent(f3vm, (AccessWatchpointEvent)evt);
} else if (evt instanceof BreakpointEvent) {
return new F3BreakpointEvent(f3vm, (BreakpointEvent)evt);
} else if (evt instanceof ClassPrepareEvent) {
return new F3ClassPrepareEvent(f3vm, (ClassPrepareEvent)evt);
} else if (evt instanceof ClassUnloadEvent) {
return new F3ClassUnloadEvent(f3vm, (ClassUnloadEvent)evt);
} else if (evt instanceof ExceptionEvent) {
return new F3ExceptionEvent(f3vm, (ExceptionEvent)evt);
} else if (evt instanceof MethodEntryEvent) {
return new F3MethodEntryEvent(f3vm, (MethodEntryEvent)evt);
} else if (evt instanceof MethodExitEvent) {
return new F3MethodExitEvent(f3vm, (MethodExitEvent)evt);
} else if (evt instanceof ModificationWatchpointEvent) {
return new F3ModificationWatchpointEvent(f3vm, (ModificationWatchpointEvent)evt);
} else if (evt instanceof MonitorContendedEnterEvent) {
return new F3MonitorContendedEnterEvent(f3vm, (MonitorContendedEnterEvent)evt);
} else if (evt instanceof MonitorContendedEnteredEvent) {
return new F3MonitorContendedEnteredEvent(f3vm, (MonitorContendedEnteredEvent)evt);
} else if (evt instanceof MonitorWaitEvent) {
return new F3MonitorWaitEvent(f3vm, (MonitorWaitEvent)evt);
} else if (evt instanceof MonitorWaitedEvent) {
return new F3MonitorWaitedEvent(f3vm, (MonitorWaitedEvent)evt);
} else if (evt instanceof StepEvent) {
return new F3StepEvent(f3vm, (StepEvent)evt);
} else if (evt instanceof ThreadDeathEvent) {
return new F3ThreadDeathEvent(f3vm, (ThreadDeathEvent)evt);
} else if (evt instanceof ThreadStartEvent) {
return new F3ThreadStartEvent(f3vm, (ThreadStartEvent)evt);
} else if (evt instanceof VMDeathEvent) {
return new F3VMDeathEvent(f3vm, (VMDeathEvent)evt);
} else if (evt instanceof VMDisconnectEvent) {
return new F3VMDisconnectEvent(f3vm, (VMDisconnectEvent)evt);
} else if (evt instanceof VMStartEvent) {
return new F3VMStartEvent(f3vm, (VMStartEvent)evt);
} else if (evt instanceof WatchpointEvent) {
return new F3WatchpointEvent(f3vm, (WatchpointEvent)evt);
} else if (evt instanceof LocatableEvent) {
return new F3LocatableEvent(f3vm, (LocatableEvent)evt);
} else {
return new F3Event(f3vm, evt);
}
}
示例3: jdiStep
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
@Override
public void jdiStep(final StepEvent event)
{
if (!override && !owner.isStarted())
{
return;
}
try
{
delegate.handleStep(event, manager().generateLocalEvents());
// if (manager().generateLockEvents()) {
// inspectThreads();
// }
}
catch (final Throwable e)
{
JiveDebugPlugin.log(e);
}
}
示例4: acceptsStep
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
/**
* Step events are filtered according to accepted types and methods.
*/
@Override
public boolean acceptsStep(final StepEvent event)
{
if (!acceptsLocation(event.location()))
{
return false;
}
ObjectReference oref;
try
{
oref = event.thread().frame(0).thisObject();
}
catch (final IncompatibleThreadStateException e)
{
oref = null;
}
// step's context type
if (oref != null && !acceptsType(oref.referenceType()))
{
return false;
}
return true;
}
示例5: jdiStep
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
@Override
public void jdiStep(final StepEvent event)
{
final Method method = event.location().method();
if (method.isSynthetic() || method.isBridge() || method.name().contains("$"))
{
return;
}
//
this.currentEvent = event;
this.currentThread = event.thread();
//
final long[] eventId = registry.encode(EventHandlerLite.KIND_LINE_STEP);
//
System.out.format(EventHandlerLite.ENCODED_LINE_STEP, eventId[0], eventId[1]);
//
System.out.println(registry.decode(eventId));
//
this.currentEvent = null;
this.currentThread = null;
}
示例6: step
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
@Override
public void step(StepEvent event) {
MethodEntity entity = new MethodEntity();
com.sun.jdi.Method method = event.location().method();
entity.setClassName(method.declaringType().signature());
entity.setMethodName(method.name());
entity.setDescription(method.signature());
MethodTracer tracer = simplify.getTracerMap().get(entity);
if (tracer != null) {
parse(tracer, event.thread(), event.location());
}
}
示例7: handleEvent
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
@Override
public void handleEvent(Event event) {
StepEvent se = (StepEvent)event;
// long index = se.location().codeIndex();
// System.out.println("index: " + index);
if (listener != null) {
listener.step(se);
}
if (se.thread().isSuspended())
se.thread().resume();
else {
util.Logger("[Method Step]thread is not suspend");
}
}
示例8: doStep
import com.sun.jdi.event.StepEvent; //导入依赖的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;
}
示例9: resumeToStep
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
public StepEvent resumeToStep() {
return (StepEvent) resumeToEvent(new EventFilter() {
public boolean match(Event evt) {
return (evt instanceof StepEvent);
}
});
}
示例10: stepEvent
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
public void stepEvent(StepEvent evt) {
synchronized (listeners) {
for (EventNotifier en : listeners) {
en.stepEvent(evt);
}
}
}
示例11: handleEvent
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
@Override
public boolean handleEvent(final Event event, final JDIDebugTarget target,
final boolean suspendVote, final EventSet eventSet)
{
final StepEvent stepEvent = (StepEvent) event;
if (isActive())
{
jdiHandler.jdiStep(stepEvent);
}
boolean result = true;
final JDTStepHandler stepHandler = getPendingStepHandler();
if (stepHandler != null)
{
switch (stepHandler.getStepKind())
{
case StepRequest.STEP_INTO:
if (shouldHandleStepInto(stepEvent.location()))
{
result = stepHandler.handleEvent(event, target, suspendVote, eventSet);
}
break;
case StepRequest.STEP_OVER:
if (shouldHandleStepOver(stepEvent.location()))
{
result = stepHandler.handleEvent(event, target, suspendVote, eventSet);
}
break;
case StepRequest.STEP_OUT:
if (shouldHandleStepReturn(stepEvent.location()))
{
result = stepHandler.handleEvent(event, target, suspendVote, eventSet);
}
break;
default:
// TODO log error
break;
}
}
return result;
}
示例12: handleStep
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
/**
* No steps from filtered methods.
*/
void handleStep(final StepEvent event, final boolean generateLocals)
throws IncompatibleThreadStateException, AbsentInformationException
{
if (!eventFilter().acceptsStep(event))
{
return;
}
// adjust the stack frames if necessary
final StackFrame frame = determineStackFrame(event);
// no support for out-of-model step events
if (!eventFilter().acceptsMethod(frame.location().method(), frame.thread()))
{
return;
}
// handle a pending array result
if (manager().generateArrayEvents()
&& executionState().lookupArrayResult(frame.thread()) != null)
{
processArrayCellWrite(event.location(), frame,
executionState().lookupArrayResult(frame.thread()));
executionState().removeArrayResult(frame.thread());
}
// handle a pending returned event if necessary
final boolean withPendingReturn = handlePendingReturned(event.location(), frame, event.thread());
// handle locals if necessary-- a write is inferred *after* it has been performed
if (generateLocals && !withPendingReturn)
{
/**
* if a pending return was processed, VarAssign/VarDelete events should rely on the locatable
* event for their source location.
*/
handleLocals(withPendingReturn ? event : null, frame, event.location());
}
// record the step
dispatcher().dispatchStepEvent(event.location(), frame);
}
示例13: stepEvents
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
/**
* Gets the observable object for step events.
* @return the observable object for step events
*/
@Override
public Observable<DebugEvent> stepEvents() {
return this.events().filter(debugEvent -> debugEvent.event instanceof StepEvent);
}
示例14: F3StepEvent
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
public F3StepEvent(F3VirtualMachine f3vm, StepEvent underlying) {
super(f3vm, underlying);
}
示例15: underlying
import com.sun.jdi.event.StepEvent; //导入依赖的package包/类
@Override
protected StepEvent underlying() {
return (StepEvent) super.underlying();
}