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


Java ExceptionEvent类代码示例

本文整理汇总了Java中com.sun.jdi.event.ExceptionEvent的典型用法代码示例。如果您正苦于以下问题:Java ExceptionEvent类的具体用法?Java ExceptionEvent怎么用?Java ExceptionEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExceptionEvent类属于com.sun.jdi.event包,在下文中一共展示了ExceptionEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: wrap

import com.sun.jdi.event.ExceptionEvent; //导入依赖的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);
    }
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:49,代码来源:F3Event.java

示例2: resumeToException

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
public ExceptionEvent resumeToException() {
    return (ExceptionEvent) resumeToEvent(new EventFilter() {
        public boolean match(Event evt) {
            return (evt instanceof ExceptionEvent);
        }
    });
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:8,代码来源:Debugger.java

示例3: jdiExceptionThrown

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
@Override
public synchronized void jdiExceptionThrown(final ExceptionEvent event)
{
  if (!override && !owner.isStarted())
  {
    return;
  }
  try
  {
    delegate.handleExceptionThrown(event);
  }
  catch (final Throwable e)
  {
    JiveDebugPlugin.log(e);
  }
}
 
开发者ID:UBPL,项目名称:jive,代码行数:17,代码来源:JDIEventHandler.java

示例4: createCatchEvent

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
IJiveEvent createCatchEvent(final StackFrame catchFrame, final ExceptionEvent event)
{
  final IThreadValue threadId = resolveThread(catchFrame);
  final StackFrame frame = executionState().framePeek(catchFrame.thread().uniqueID());
  if (!executionState().containsInModelFrame(frame))
  {
    throw new IllegalStateException("A method contour was not found for the given stack frame.");
  }
  final IMethodContour catcher = executionState().lookupContour(frame);
  final IValue exception = resolveReference(event.thread(), event.exception(), null);
  final IContourMember variable = resolveCatchVariable(event, catchFrame, catcher);
  // update the source location-- no harm done if the location hasn't changed
  executionState().nextLine(threadId, resolveLine(event.catchLocation()));
  final ILineValue line = executionState().currentLine(threadId);
  return eventFactory().createExceptionCatchEvent(threadId, line, exception, variable);
}
 
开发者ID:UBPL,项目名称:jive,代码行数:17,代码来源:EventFactoryAdapter.java

示例5: eventLoop

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
private void eventLoop() throws InterruptedException {
	System.out.println("eventLoop started");
	EventQueue eventQueue = vm.eventQueue();
	boolean isRunning = true;
	while (isRunning) {
		EventSet eventSet = eventQueue.remove();
		boolean mayResume = true;
		for (Event event : eventSet) {
			System.out.println(event);
			if (event instanceof VMDeathEvent
					|| event instanceof VMDisconnectEvent) {
				isRunning = false;
			} else if (event instanceof ExceptionEvent) {
				mayResume = false;
			}
		}
		if (mayResume) eventSet.resume();
	}
}
 
开发者ID:gravel-st,项目名称:gravel,代码行数:20,代码来源:VMRemoteTarget.java

示例6: processThis

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
private Data processThis(ExceptionEvent 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;
}
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:17,代码来源:ExceptionManager.java

示例7: handleEvent

import com.sun.jdi.event.ExceptionEvent; //导入依赖的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);
       } 
   }
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:21,代码来源:EventThread.java

示例8: exceptionEvent

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
public void exceptionEvent(ExceptionEvent evt) {
    synchronized (listeners) {
        for (EventNotifier en : listeners) {
            en.exceptionEvent(evt);
        }
    }
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:8,代码来源:Debugger.java

示例9: checkExceptionEvent

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
/**
* We call this method just before throwing an Exception and make sure it ExceptionEvent.
*/
   private void checkExceptionEvent() {
       Event event = resumeToAnyEvent();
       System.out.println("Exception request is " + event);
       Assert.assertTrue(event instanceof ExceptionEvent || event instanceof ThreadStartEvent);
       list();
   }
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:10,代码来源:ExceptionCatchTest.java

示例10: handleEvent

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
@Override
public boolean handleEvent(final Event event, final JDIDebugTarget target,
    final boolean suspendVote, final EventSet eventSet)
{
  if (owner.isActive())
  {
    owner.jdiHandler().jdiExceptionThrown((ExceptionEvent) event);
  }
  return true;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:11,代码来源:EventHandlerFactory.java

示例11: createThrowEvent

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
IJiveEvent createThrowEvent(final ExceptionEvent event, final boolean framePopped)
{
  final IThreadValue threadId = resolveThread(event);
  final IValue thrower = resolveThrower(event.thread(), framePopped);
  final IValue exception = resolveReference(event.thread(), event.exception(), null);
  // defensively record the location-- no harm done if the location hasn't changed
  final ILineValue nextLine = resolveLine(event.location());
  if (nextLine != valueFactory().createUnavailableLine())
  {
    executionState().nextLine(threadId, nextLine);
  }
  final ILineValue line = executionState().currentLine(threadId);
  return eventFactory()
      .createExceptionThrowEvent(threadId, line, exception, thrower, framePopped);
}
 
开发者ID:UBPL,项目名称:jive,代码行数:16,代码来源:EventFactoryAdapter.java

示例12: outstandingException

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
private ExceptionEvent outstandingException(final ThreadReference thread)
{
  final ExceptionEvent result = executionState().lookupException(thread.uniqueID());
  if (result == null)
  {
    throw new IllegalStateException("An exception has not occurred on the thread.");
  }
  return result;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:10,代码来源:JDIEventHandlerDelegate.java

示例13: handleThreadDeath

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
void handleThreadDeath(final ThreadDeathEvent event)
{
  final ThreadReference thread = event.thread();
  /**
   * If a thread dies with outstanding frames, then all frames are popped with an exception. An
   * unexpected termination is gracefully handled by the execution model.
   */
  while (executionState().frameCount(thread.uniqueID()) != 0)
  {
    // if by any chance the VM generated a throw event
    if (executionState().containsException(thread.uniqueID()))
    {
      final ExceptionEvent exception = outstandingException(thread);
      dispatcher().dispatchThrowEvent(exception, true);
    }
    else
    {
      dispatcher().dispatchThrowEvent(thread, true);
    }
  }
  if (executionState().containsException(thread.uniqueID()))
  {
    removeException(thread);
  }
  handlePendingReturned(null, null, event.thread());
  final IThreadValue threadValue = owner.model().valueFactory()
      .createThread(thread.uniqueID(), thread.name());
  // avoid duplicate thread termination
  final IThreadStartEvent threadStart = owner.model().lookupThread(threadValue);
  if (threadStart != null && threadStart.terminator() == null)
  {
    dispatcher().dispatchThreadDeath(event.thread());
  }
}
 
开发者ID:UBPL,项目名称:jive,代码行数:35,代码来源:JDIEventHandlerDelegate.java

示例14: 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;
}
 
开发者ID:UBPL,项目名称:jive,代码行数:25,代码来源:EventHandlerLite.java

示例15: exceptionEvents

import com.sun.jdi.event.ExceptionEvent; //导入依赖的package包/类
/**
 * Gets the observable object for exception events.
 * @return      the observable object for exception events
 */
@Override
public  Observable<DebugEvent> exceptionEvents() {
    return this.events().filter(debugEvent -> debugEvent.event instanceof ExceptionEvent);
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:9,代码来源:EventHub.java


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