当前位置: 首页>>代码示例>>Java>>正文


Java MethodExitEvent.thread方法代码示例

本文整理汇总了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;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:36,代码来源:EventHandlerLite.java

示例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);	
    }
     
}
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:31,代码来源:MethodExitManager.java


注:本文中的com.sun.jdi.event.MethodExitEvent.thread方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。