本文整理汇总了Java中com.sun.jdi.event.ExceptionEvent.thread方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionEvent.thread方法的具体用法?Java ExceptionEvent.thread怎么用?Java ExceptionEvent.thread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jdi.event.ExceptionEvent
的用法示例。
在下文中一共展示了ExceptionEvent.thread方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jdiExceptionThrown
import com.sun.jdi.event.ExceptionEvent; //导入方法依赖的package包/类
/**
* Notification of an exception in the target VM. When an exception is thrown which satisfies a
* currently enabled exception request, an event set containing an instance of this class will be
* added to the VM's event queue. If the exception is thrown from a non-native method, the
* exception event is generated at the location where the exception is thrown. If the exception is
* thrown from a native method, the exception event is generated at the first non-native location
* reached after the exception is thrown.
*
* @param event
*
* @see <a href="">http://docs.oracle.com/javase/7/docs/jdk/api/jpda/jdi/index.html</a>
*/
@Override
public void jdiExceptionThrown(final ExceptionEvent event)
{
//
//
this.currentEvent = event;
this.currentThread = event.thread();
//
//
this.currentEvent = null;
this.currentThread = null;
}
示例2: exceptionEvent
import com.sun.jdi.event.ExceptionEvent; //导入方法依赖的package包/类
public void exceptionEvent(ExceptionEvent event) {
ThreadReference thread = event.thread();
Location lo = event.catchLocation();
String classException = event.location().declaringType().name();
if (!classException.contains("ClassLoader") && lo == null) {
try {
List<StackFrame> list = null;
list = thread.frames();
int i = 0;
while (list.size() > i) {
StackFrame frame = list.get(i);
String className = frame.location().declaringType().name();
if (!utils.isExcludedClass(className)){
String method = frame.location().method().name();
List<Data> arguments = processArguments(frame.location()
.method(), frame.thread());
Data returnObject = utils.getObjectFromObjectReference(
false, "Exception", event.exception(),
new ArrayList<Long>());
ReferenceType ref = event.location().method()
.declaringType(); // "class" where is declaring the
// method
Data object_this = processThis(event, ref, thread);
MethodExitInfo info = new MethodExitInfo(method, className,
returnObject, arguments, object_this);
writer.writeMethodExitInfo(info);
}
i++;
}
} catch (IncompatibleThreadStateException e) {
}
}
}