本文整理汇总了Java中com.sun.jdi.event.MethodExitEvent.thread方法的典型用法代码示例。如果您正苦于以下问题:Java MethodExitEvent.thread方法的具体用法?Java MethodExitEvent.thread怎么用?Java MethodExitEvent.thread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jdi.event.MethodExitEvent
的用法示例。
在下文中一共展示了MethodExitEvent.thread方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: methodExitEvent
import com.sun.jdi.event.MethodExitEvent; //导入方法依赖的package包/类
public void methodExitEvent(MethodExitEvent event) {
ThreadReference thread = event.thread();
Method method = event.method();
String className = ClassUtils.getClass(method.declaringType());
String methodName = method.name();
List<Data> arguments = processArguments(method,thread);
Value returnValue = event.returnValue();
Data returnObject = null;
if (!(returnValue instanceof VoidValue))
returnObject = utils.getObj("return",returnValue,new ArrayList<Long>());
ReferenceType ref = method.declaringType(); // "class" where is declaring the method
Data object_this = null;
if (!Settings.getInstance().isExcludedThis())
object_this = processThis(event,ref, thread);
MethodExitInfo info = new MethodExitInfo(methodName,className,returnObject,arguments,object_this);
synchronized (writer) {
writer.writeMethodExitInfo(info);
}
}