ExceptionEvent.java revision 0
3845N/A/*
3845N/A * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved.
3845N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3845N/A *
3845N/A * This code is free software; you can redistribute it and/or modify it
3845N/A * under the terms of the GNU General Public License version 2 only, as
3845N/A * published by the Free Software Foundation. Sun designates this
3845N/A * particular file as subject to the "Classpath" exception as provided
3845N/A * by Sun in the LICENSE file that accompanied this code.
3845N/A *
3845N/A * This code is distributed in the hope that it will be useful, but WITHOUT
3845N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3845N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3845N/A * version 2 for more details (a copy is included in the LICENSE file that
3845N/A * accompanied this code).
3845N/A *
3845N/A * You should have received a copy of the GNU General Public License version
3845N/A * 2 along with this work; if not, write to the Free Software Foundation,
3845N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3845N/A *
3845N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
3845N/A * CA 95054 USA or visit www.sun.com if you need additional information or
3845N/A * have any questions.
3845N/A */
3845N/A
3845N/Apackage com.sun.jdi.event;
3845N/A
3845N/Aimport com.sun.jdi.*;
3845N/A
3845N/A/**
3845N/A * Notification of an exception in the target VM. When an exception
3845N/A * is thrown which satisfies a currently enabled
3845N/A * {@link com.sun.jdi.request.ExceptionRequest exception request},
3845N/A * an {@link EventSet event set}
3845N/A * containing an instance of this class will be added
3845N/A * to the VM's event queue.
3845N/A * If the exception is thrown from a non-native method,
3845N/A * the exception event is generated at the location where the
3845N/A * exception is thrown.
3845N/A * If the exception is thrown from a native method, the exception event
3845N/A * is generated at the first non-native location reached after the exception
3845N/A * is thrown.
3845N/A *
3845N/A * @author Robert Field
3845N/A * @since 1.3
3845N/A */
3845N/Apublic interface ExceptionEvent extends LocatableEvent {
3845N/A
3845N/A /**
3845N/A * Gets the thrown exception object. The exception object is
3845N/A * an instance of {@link java.lang.Throwable} or a subclass in the
3845N/A * target VM.
3845N/A *
3845N/A * @return an {@link ObjectReference} which mirrors the thrown object in
3845N/A * the target VM.
3845N/A */
3845N/A public ObjectReference exception();
3845N/A
3845N/A /**
3845N/A * Gets the location where the exception will be caught. An exception
3845N/A * is considered to be caught if, at the point of the throw, the
3845N/A * current location is dynamically enclosed in a try statement that
3845N/A * handles the exception. (See the JVM specification for details).
3845N/A * If there is such a try statement, the catch location is the
3845N/A * first code index of the appropriate catch clause.
3845N/A * <p>
3845N/A * If there are native methods in the call stack at the time of the
3845N/A * exception, there are important restrictions to note about the
3845N/A * returned catch location. In such cases,
3845N/A * it is not possible to predict whether an exception will be handled
3845N/A * by some native method on the call stack.
3845N/A * Thus, it is possible that exceptions considered uncaught
3845N/A * here will, in fact, be handled by a native method and not cause
3845N/A * termination of the target VM. Furthermore, it cannot be assumed that the
3845N/A * catch location returned here will ever be reached by the throwing
3845N/A * thread. If there is
3845N/A * a native frame between the current location and the catch location,
3845N/A * the exception might be handled and cleared in that native method
3845N/A * instead.
3845N/A * <p>
3845N/A * Note that the compiler can generate try-catch blocks in some cases
3845N/A * where they are not explicit in the source code; for example,
3845N/A * the code generated for <code>synchronized</code> and
3845N/A * <code>finally</code> blocks can contain implicit try-catch blocks.
3845N/A * If such an implicitly generated try-catch is
3845N/A * present on the call stack at the time of the throw, the exception
3845N/A * will be considered caught even though it appears to be uncaught from
3845N/A * examination of the source code.
3845N/A *
3845N/A * @return the {@link Location} where the exception will be caught or null if
3845N/A * the exception is uncaught.
3845N/A */
3845N/A public Location catchLocation();
3845N/A}
3845N/A