本文整理汇总了Java中com.sun.jdi.event.MethodExitEvent类的典型用法代码示例。如果您正苦于以下问题:Java MethodExitEvent类的具体用法?Java MethodExitEvent怎么用?Java MethodExitEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MethodExitEvent类属于com.sun.jdi.event包,在下文中一共展示了MethodExitEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: wrap
import com.sun.jdi.event.MethodExitEvent; //导入依赖的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);
}
}
示例2: jdiMethodExit
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
@Override
public synchronized void jdiMethodExit(final MethodExitEvent event)
{
if (!override && !owner.isStarted())
{
return;
}
try
{
delegate.handleMethodExit(event, manager().generateLocalEvents());
// if (manager().generateLockEvents()) {
// inspectThreads();
// }
}
catch (final Throwable e)
{
JiveDebugPlugin.log(e);
}
}
示例3: resolveReturnValue
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
private IValue resolveReturnValue(final MethodExitEvent event)
{
if (event.method().returnTypeName().equalsIgnoreCase(EventFactoryAdapter.VOID_TYPE_NAME))
{
return null;
}
// Java SE 6 or later supports method return values
if (event.virtualMachine().canGetMethodReturnValues())
{
return resolveValue(event.thread(), event.returnValue(), event.method().returnTypeName());
}
// Support for J2SE 1.5
else
{
return valueFactory().createUninitializedValue();
}
}
示例4: createMethodExitEvent
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
IJiveEvent createMethodExitEvent(final MethodExitEvent event)
{
final IThreadValue threadId = resolveThread(event);
ILineValue line = executionState().currentLine(threadId);
final String methodKey = executionState().methodKey(event.location().method());
if (methodKey.contains(".access$") && event.location().method().isSynthetic())
{
// System.err.println("SYNTHETIC_ACCESSOR_METHOD_EXIT[" + methodKey + "]");
// retrieve the source location at the origin of the synthetic accessor call
line = executionState().removeSyntheticAccessor(methodKey);
}
final IMethodTerminatorEvent terminator = (IMethodTerminatorEvent) eventFactory()
.createMethodExitEvent(threadId, line);
executionState().methodReturnedPending(event.thread().uniqueID(), terminator);
executionState().framePop(event.thread().uniqueID());
return terminator;
}
示例5: jdiMethodExit
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
/**
* Notification of a method return in the target VM. This event is generated after all code in the
* method has executed, but the location of this event is the last executed location in the
* method. Method exit events are generated for both native and non-native methods. Method exit
* events are not generated if the method terminates with a thrown exception.
*
* @param event
*
* @see <a href="">http://docs.oracle.com/javase/7/docs/jdk/api/jpda/jdi/index.html</a>
*/
@Override
public void jdiMethodExit(final MethodExitEvent event)
{
if (event.method().isSynthetic() || event.method().isBridge()
|| event.method().name().contains("$"))
{
return;
}
//
this.currentEvent = event;
this.currentThread = event.thread();
//
final long thId = registry.getThreadId(event.thread());
//
final long[] eventId = registry.encode(EventHandlerLite.KIND_METHOD_EXITING);
//
final long nfrId = registry.methodExiting(thId);
//
System.out.format(EventHandlerLite.ENCODED_METHOD_EXITING, eventId[0], eventId[1], nfrId);
//
System.out.println(registry.decode(eventId));
//
this.currentEvent = null;
this.currentThread = null;
}
示例6: handleEvent
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
/**
* Dispatch incoming events
*/
private void handleEvent(Event event) {
if (event instanceof ExceptionEvent) {
if (!enableProfiling)
exceptionManager.exceptionEvent((ExceptionEvent)event);
} else if (event instanceof MethodEntryEvent) {
methodEntryEvent((MethodEntryEvent)event);
} else if (event instanceof MethodExitEvent) {
methodExitEvent((MethodExitEvent)event);
} else if (event instanceof ThreadDeathEvent) {
threadeath.threadDeathEvent((ThreadDeathEvent)event);
} else if (event instanceof VMDeathEvent) {
vmDeathEvent((VMDeathEvent)event);
} else if (event instanceof VMDisconnectEvent) {
connected = disconnect.vmDisconnectEvent((VMDisconnectEvent)event);
}
}
示例7: exit
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
@Override
public void exit(MethodExitEvent event) {
MethodEntity entity = new MethodEntity();
com.sun.jdi.Method method = event.method();
entity.setClassName(method.declaringType().signature());
entity.setMethodName(method.name());
entity.setDescription(method.signature());
simplify.addtask(simplify.getTracerMap().get(entity), entity);
simplify.getTracerMap().remove(entity);
if (simplify.getTracerMap().size() == 0) {
simplify.close();
ctx.close();
}
}
示例8: methodExitEvent
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
public boolean methodExitEvent(MethodExitEvent evt) {
boolean result = false;
synchronized (listeners) {
for (EventNotifier en : listeners) {
result |= en.methodExitEvent(evt);
}
}
return result;
}
示例9: checkEntryExit
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
/**
* Convenient method that compares the method name (extracted from event) with the given set of names.
* @param event
* @param methodName1
* @param methodName2
*/
private void checkEntryExit(Event event, String methodName1, String methodName2) {
if (event instanceof MethodEntryEvent) {
System.out.println("Starting method = " + ((MethodEntryEvent)event).method().toString());
Assert.assertTrue(((MethodEntryEvent)event).method().toString().equals(methodName1) || ((MethodEntryEvent)event).method().toString().equals(methodName2));
}else if (event instanceof MethodExitEvent) {
System.out.println("Exiting method = " + ((MethodExitEvent)event).method().toString());
Assert.assertTrue(((MethodExitEvent)event).method().toString().equals(methodName1) || ((MethodExitEvent)event).method().toString().equals(methodName2));
}
}
示例10: handleEvent
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
@Override
public boolean handleEvent(final Event event, final JDIDebugTarget target,
final boolean suspendVote, final EventSet eventSet)
{
if (owner.isActive())
{
owner.jdiHandler().jdiMethodExit((MethodExitEvent) event);
}
return true;
}
示例11: createMethodResultEvent
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
IJiveEvent createMethodResultEvent(final MethodExitEvent event)
{
final IThreadValue threadId = resolveThread(event);
final StackFrame activation = executionState().framePeek(event.thread().uniqueID());
final IMethodContour method = executionState().lookupContour(activation);
final IValue value = resolveReturnValue(event);
final IContourMember instance = method.lookupResultMember();
// defensively record the location-- no harm done if the location hasn't changed
executionState().nextLine(threadId, resolveLine(event.location()));
final ILineValue line = executionState().currentLine(threadId);
return eventFactory().createVarAssignEvent(threadId, line, value, instance);
}
示例12: handleMethodExit
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
/**
* Filtered method calls/returns are captured lazily by determineStackFrame(event).
*/
void handleMethodExit(final MethodExitEvent event, final boolean generateLocals)
throws IncompatibleThreadStateException, AbsentInformationException
{
if (!eventFilter().acceptsMethod(event.method(), event.thread()))
{
return;
}
final StackFrame frame = determineStackFrame(event);
// local variable writes on the return line could be missed without this
if (generateLocals)
{
handleLocals(null, frame, event.location());
}
// handle a pending returned event if necessary
handlePendingReturned(event.location(), frame, event.thread());
if (!event.method().returnTypeName().equalsIgnoreCase(JDIEventHandlerDelegate.VOID_TYPE_NAME))
{
final Value result = event.returnValue();
if (manager().generateArrayEvents() && result instanceof ArrayReference)
{
// dispatch a new array event and the respective cell assignments
handleNewArray((ArrayReference) result, event.location(), frame);
}
// dispatch a result event
dispatcher().dispatchMethodResultEvent(event);
}
// unregister this contour's local variables
if (generateLocals && !frame.location().method().isNative())
{
removeLocals(frame);
}
// dispatch the event
dispatcher().dispatchMethodExitEvent(event);
}
示例13: processThis
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
private Data processThis(MethodExitEvent event, ReferenceType ref, ThreadReference thread) {
StackFrame stack=null;
try {
stack = thread.frame(0);
} catch (IncompatibleThreadStateException e) {
e.printStackTrace();
}
Data valueThis = utils.getObj("this",stack.thisObject(),new ArrayList<Long>());
return valueThis;
}
示例14: methodExitEvent
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
private void methodExitEvent(MethodExitEvent event) {
String methodName = event.method().toString();
String className = ClassUtils.getClass(event.method().declaringType());
if (!excludesClassMethods.isExcluded(className,methodName) && !className.contains("$")){
if (!enableProfiling)
methodExitManager.methodExitEvent((MethodExitEvent)event);
}
}
示例15: F3MethodExitEvent
import com.sun.jdi.event.MethodExitEvent; //导入依赖的package包/类
public F3MethodExitEvent(F3VirtualMachine f3vm, MethodExitEvent underlying) {
super(f3vm, underlying);
}