feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
@@ -0,0 +1,272 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
import com.sun.jdi.request.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public abstract class AbstractEventSet extends EventObject implements EventSet {
|
||||
|
||||
private static final long serialVersionUID = 2772717574222076977L;
|
||||
private final EventSet jdiEventSet;
|
||||
final Event oneEvent;
|
||||
|
||||
/**
|
||||
*/
|
||||
AbstractEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet.virtualMachine());
|
||||
this.jdiEventSet = jdiEventSet;
|
||||
this.oneEvent = eventIterator().nextEvent();
|
||||
}
|
||||
|
||||
public static AbstractEventSet toSpecificEventSet(EventSet jdiEventSet) {
|
||||
Event evt = jdiEventSet.eventIterator().nextEvent();
|
||||
if (evt instanceof LocatableEvent) {
|
||||
if (evt instanceof ExceptionEvent) {
|
||||
return new ExceptionEventSet(jdiEventSet);
|
||||
} else if (evt instanceof WatchpointEvent) {
|
||||
if (evt instanceof AccessWatchpointEvent) {
|
||||
return new AccessWatchpointEventSet(jdiEventSet);
|
||||
} else {
|
||||
return new ModificationWatchpointEventSet(jdiEventSet);
|
||||
}
|
||||
} else {
|
||||
return new LocationTriggerEventSet(jdiEventSet);
|
||||
}
|
||||
} else if (evt instanceof ClassPrepareEvent) {
|
||||
return new ClassPrepareEventSet(jdiEventSet);
|
||||
} else if (evt instanceof ClassUnloadEvent) {
|
||||
return new ClassUnloadEventSet(jdiEventSet);
|
||||
} else if (evt instanceof ThreadDeathEvent) {
|
||||
return new ThreadDeathEventSet(jdiEventSet);
|
||||
} else if (evt instanceof ThreadStartEvent) {
|
||||
return new ThreadStartEventSet(jdiEventSet);
|
||||
} else if (evt instanceof VMDeathEvent) {
|
||||
return new VMDeathEventSet(jdiEventSet);
|
||||
} else if (evt instanceof VMDisconnectEvent) {
|
||||
return new VMDisconnectEventSet(jdiEventSet);
|
||||
} else if (evt instanceof VMStartEvent) {
|
||||
return new VMStartEventSet(jdiEventSet);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown event " + evt);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void notify(JDIListener listener);
|
||||
|
||||
// Implement Mirror
|
||||
|
||||
@Override
|
||||
public VirtualMachine virtualMachine() {
|
||||
return jdiEventSet.virtualMachine();
|
||||
}
|
||||
|
||||
public VirtualMachine getVirtualMachine() {
|
||||
return jdiEventSet.virtualMachine();
|
||||
}
|
||||
|
||||
// Implement EventSet
|
||||
|
||||
/**
|
||||
* Returns the policy used to suspend threads in the target VM
|
||||
* for this event set. This policy is selected from the suspend
|
||||
* policies for each event's request. The one that suspends the
|
||||
* most threads is chosen when the event occurs in the target VM
|
||||
* and that policy is returned here. See
|
||||
* com.sun.jdi.request.EventRequest for the possible policy values.
|
||||
*
|
||||
* @return the integer suspendPolicy
|
||||
*/
|
||||
public int getSuspendPolicy() {
|
||||
return jdiEventSet.suspendPolicy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume() {
|
||||
jdiEventSet.resume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int suspendPolicy() {
|
||||
return jdiEventSet.suspendPolicy();
|
||||
}
|
||||
|
||||
public boolean suspendedAll() {
|
||||
return jdiEventSet.suspendPolicy() == EventRequest.SUSPEND_ALL;
|
||||
}
|
||||
|
||||
public boolean suspendedEventThread() {
|
||||
return jdiEventSet.suspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD;
|
||||
}
|
||||
|
||||
public boolean suspendedNone() {
|
||||
return jdiEventSet.suspendPolicy() == EventRequest.SUSPEND_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an iterator specific to {@link Event} objects.
|
||||
*/
|
||||
@Override
|
||||
public EventIterator eventIterator() {
|
||||
return jdiEventSet.eventIterator();
|
||||
}
|
||||
|
||||
|
||||
// Implement java.util.Set (by pass through)
|
||||
|
||||
/**
|
||||
* Returns the number of elements in this set (its cardinality). If this
|
||||
* set contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
|
||||
* <tt>Integer.MAX_VALUE</tt>.
|
||||
*
|
||||
* @return the number of elements in this set (its cardinality).
|
||||
*/
|
||||
@Override
|
||||
public int size() {
|
||||
return jdiEventSet.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if this set contains no elements.
|
||||
*
|
||||
* @return <tt>true</tt> if this set contains no elements.
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return jdiEventSet.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if this set contains the specified element. More
|
||||
* formally, returns <tt>true</tt> if and only if this set contains an
|
||||
* element <code>e</code> such that <code>(o==null ? e==null :
|
||||
* o.equals(e))</code>.
|
||||
*
|
||||
* @return <tt>true</tt> if this set contains the specified element.
|
||||
*/
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
return jdiEventSet.contains(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator over the elements in this set. The elements are
|
||||
* returned in no particular order (unless this set is an instance of some
|
||||
* class that provides a guarantee).
|
||||
*
|
||||
* @return an iterator over the elements in this set.
|
||||
*/
|
||||
@Override
|
||||
public Iterator<Event> iterator() {
|
||||
return jdiEventSet.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array containing all of the elements in this set.
|
||||
* Obeys the general contract of the <tt>Collection.toArray</tt> method.
|
||||
*
|
||||
* @return an array containing all of the elements in this set.
|
||||
*/
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
return jdiEventSet.toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array containing all of the elements in this set whose
|
||||
* runtime type is that of the specified array. Obeys the general
|
||||
* contract of the <tt>Collection.toArray(Object[])</tt> method.
|
||||
*
|
||||
* @param a the array into which the elements of this set are to
|
||||
* be stored, if it is big enough {
|
||||
return jdiEventSet.XXX();
|
||||
} otherwise, a new array of the
|
||||
* same runtime type is allocated for this purpose.
|
||||
* @return an array containing the elements of this set.
|
||||
* @throws ArrayStoreException the runtime type of a is not a supertype
|
||||
* of the runtime type of every element in this set.
|
||||
*/
|
||||
@Override
|
||||
public <T> T[] toArray(T a[]) {
|
||||
return jdiEventSet.toArray(a);
|
||||
}
|
||||
|
||||
// Bulk Operations
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if this set contains all of the elements of the
|
||||
* specified collection. If the specified collection is also a set, this
|
||||
* method returns <tt>true</tt> if it is a <i>subset</i> of this set.
|
||||
*
|
||||
* @param c collection to be checked for containment in this set.
|
||||
* @return <tt>true</tt> if this set contains all of the elements of the
|
||||
* specified collection.
|
||||
*/
|
||||
@Override
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
return jdiEventSet.containsAll(c);
|
||||
}
|
||||
|
||||
|
||||
// Make the rest of Set unmodifiable
|
||||
|
||||
@Override
|
||||
public boolean add(Event e){
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@Override
|
||||
public boolean addAll(Collection<? extends Event> coll) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@Override
|
||||
public boolean removeAll(Collection<?> coll) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@Override
|
||||
public boolean retainAll(Collection<?> coll) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class AccessWatchpointEventSet extends WatchpointEventSet {
|
||||
|
||||
private static final long serialVersionUID = -2620394219156607673L;
|
||||
|
||||
AccessWatchpointEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.accessWatchpoint(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class ClassPrepareEventSet extends AbstractEventSet {
|
||||
|
||||
private static final long serialVersionUID = 5958493423581010491L;
|
||||
|
||||
ClassPrepareEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the thread in which this event has occurred.
|
||||
*
|
||||
* @return a {@link ThreadReference} which mirrors the event's thread in
|
||||
* the target VM.
|
||||
*/
|
||||
public ThreadReference getThread() {
|
||||
return ((ClassPrepareEvent)oneEvent).thread();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the reference type for which this event was generated.
|
||||
*
|
||||
* @return a {@link ReferenceType} which mirrors the class, interface, or
|
||||
* array which has been linked.
|
||||
*/
|
||||
public ReferenceType getReferenceType() {
|
||||
return ((ClassPrepareEvent)oneEvent).referenceType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.classPrepare(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class ClassUnloadEventSet extends AbstractEventSet {
|
||||
|
||||
private static final long serialVersionUID = 8370341450345835866L;
|
||||
|
||||
ClassUnloadEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the class that has been unloaded.
|
||||
*/
|
||||
public String getClassName() {
|
||||
return ((ClassUnloadEvent)oneEvent).className();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the JNI-style signature of the class that has been unloaded.
|
||||
*/
|
||||
public String getClassSignature() {
|
||||
return ((ClassUnloadEvent)oneEvent).classSignature();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.classUnload(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class ExceptionEventSet extends LocatableEventSet {
|
||||
|
||||
private static final long serialVersionUID = 5328140167954640711L;
|
||||
|
||||
ExceptionEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the thrown exception object. The exception object is
|
||||
* an instance of java.lang.Throwable or a subclass in the
|
||||
* target VM.
|
||||
*
|
||||
* @return an {@link ObjectReference} which mirrors the thrown object in
|
||||
* the target VM.
|
||||
*/
|
||||
public ObjectReference getException() {
|
||||
return ((ExceptionEvent)oneEvent).exception();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location where the exception will be caught. An exception
|
||||
* is considered to be caught if, at the point of the throw, the
|
||||
* current location is dynamically enclosed in a try statement that
|
||||
* handles the exception. (See the JVM specification for details).
|
||||
* If there is such a try statement, the catch location is the
|
||||
* first code index of the appropriate catch clause.
|
||||
* <p>
|
||||
* If there are native methods in the call stack at the time of the
|
||||
* exception, there are important restrictions to note about the
|
||||
* returned catch location. In such cases,
|
||||
* it is not possible to predict whether an exception will be handled
|
||||
* by some native method on the call stack.
|
||||
* Thus, it is possible that exceptions considered uncaught
|
||||
* here will, in fact, be handled by a native method and not cause
|
||||
* termination of the target VM. Also, it cannot be assumed that the
|
||||
* catch location returned here will ever be reached by the throwing
|
||||
* thread. If there is
|
||||
* a native frame between the current location and the catch location,
|
||||
* the exception might be handled and cleared in that native method
|
||||
* instead.
|
||||
*
|
||||
* @return the {@link Location} where the exception will be caught or null if
|
||||
* the exception is uncaught.
|
||||
*/
|
||||
public Location getCatchLocation() {
|
||||
return ((ExceptionEvent)oneEvent).catchLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.exception(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
/**
|
||||
* The adapter which receives JDI event sets. The methods in this
|
||||
* class are empty; this class is provided as a convenience for
|
||||
* easily creating listeners by extending this class and overriding
|
||||
* only the methods of interest.
|
||||
*/
|
||||
public class JDIAdapter implements JDIListener {
|
||||
|
||||
@Override
|
||||
public void accessWatchpoint(AccessWatchpointEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void classPrepare(ClassPrepareEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void classUnload(ClassUnloadEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exception(ExceptionEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void locationTrigger(LocationTriggerEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modificationWatchpoint(ModificationWatchpointEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void threadDeath(ThreadDeathEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void threadStart(ThreadStartEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void vmDeath(VMDeathEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void vmDisconnect(VMDisconnectEventSet e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void vmStart(VMStartEventSet e) {
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import java.util.EventListener;
|
||||
|
||||
public interface JDIListener extends EventListener {
|
||||
void accessWatchpoint(AccessWatchpointEventSet e);
|
||||
void classPrepare(ClassPrepareEventSet e);
|
||||
void classUnload(ClassUnloadEventSet e);
|
||||
void exception(ExceptionEventSet e);
|
||||
void locationTrigger(LocationTriggerEventSet e);
|
||||
void modificationWatchpoint(ModificationWatchpointEventSet e);
|
||||
void threadDeath(ThreadDeathEventSet e);
|
||||
void threadStart(ThreadStartEventSet e);
|
||||
void vmDeath(VMDeathEventSet e);
|
||||
void vmDisconnect(VMDisconnectEventSet e);
|
||||
void vmStart(VMStartEventSet e);
|
||||
}
|
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
/**
|
||||
* Abstract event set for events with location and thread.
|
||||
*/
|
||||
public abstract class LocatableEventSet extends AbstractEventSet {
|
||||
|
||||
private static final long serialVersionUID = 1027131209997915620L;
|
||||
|
||||
LocatableEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link Location} of this mirror. Depending on context
|
||||
* and on available debug information, this location will have
|
||||
* varying precision.
|
||||
*
|
||||
* @return the {@link Location} of this mirror.
|
||||
*/
|
||||
public Location getLocation() {
|
||||
return ((LocatableEvent)oneEvent).location();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the thread in which this event has occurred.
|
||||
*
|
||||
* @return a {@link ThreadReference} which mirrors the event's thread in
|
||||
* the target VM.
|
||||
*/
|
||||
public ThreadReference getThread() {
|
||||
return ((LocatableEvent)oneEvent).thread();
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class LocationTriggerEventSet extends LocatableEventSet {
|
||||
|
||||
private static final long serialVersionUID = -3674631710485872487L;
|
||||
|
||||
LocationTriggerEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.locationTrigger(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class ModificationWatchpointEventSet extends WatchpointEventSet {
|
||||
|
||||
private static final long serialVersionUID = -680889300856154719L;
|
||||
|
||||
ModificationWatchpointEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Value that will be assigned to the field when the instruction
|
||||
* completes.
|
||||
*/
|
||||
public Value getValueToBe() {
|
||||
return ((ModificationWatchpointEvent)oneEvent).valueToBe();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.modificationWatchpoint(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class ThreadDeathEventSet extends AbstractEventSet {
|
||||
|
||||
private static final long serialVersionUID = -8801604712308151331L;
|
||||
|
||||
ThreadDeathEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the thread which is terminating.
|
||||
*
|
||||
* @return a {@link ThreadReference} which mirrors the event's thread in
|
||||
* the target VM.
|
||||
*/
|
||||
public ThreadReference getThread() {
|
||||
return ((ThreadDeathEvent)oneEvent).thread();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.threadDeath(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class ThreadStartEventSet extends AbstractEventSet {
|
||||
|
||||
private static final long serialVersionUID = -3802096132294933502L;
|
||||
|
||||
ThreadStartEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the thread which has started.
|
||||
*
|
||||
* @return a {@link ThreadReference} which mirrors the event's thread in
|
||||
* the target VM.
|
||||
*/
|
||||
public ThreadReference getThread() {
|
||||
return ((ThreadStartEvent)oneEvent).thread();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.threadStart(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class VMDeathEventSet extends AbstractEventSet {
|
||||
|
||||
private static final long serialVersionUID = 1163097303940092229L;
|
||||
|
||||
VMDeathEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.vmDeath(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class VMDisconnectEventSet extends AbstractEventSet {
|
||||
|
||||
private static final long serialVersionUID = 7968123152344675342L;
|
||||
|
||||
VMDisconnectEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.vmDisconnect(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public class VMStartEventSet extends AbstractEventSet {
|
||||
|
||||
private static final long serialVersionUID = -3384957227835478191L;
|
||||
|
||||
VMStartEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the initial thread of the VM which has started.
|
||||
*
|
||||
* @return a {@link ThreadReference} which mirrors the event's
|
||||
* thread in the target VM.
|
||||
*/
|
||||
public ThreadReference getThread() {
|
||||
return ((VMStartEvent)oneEvent).thread();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notify(JDIListener listener) {
|
||||
listener.vmStart(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
package com.sun.tools.example.debug.event;
|
||||
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
|
||||
public abstract class WatchpointEventSet extends LocatableEventSet {
|
||||
|
||||
private static final long serialVersionUID = 5606285209703845409L;
|
||||
|
||||
WatchpointEventSet(EventSet jdiEventSet) {
|
||||
super(jdiEventSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the field that is about to be accessed/modified.
|
||||
*
|
||||
* @return a {@link Field} which mirrors the field
|
||||
* in the target VM.
|
||||
*/
|
||||
public Field getField() {
|
||||
return ((WatchpointEvent)oneEvent).field();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the object whose field is about to be accessed/modified.
|
||||
* Return null is the access is to a static field.
|
||||
*
|
||||
* @return a {@link ObjectReference} which mirrors the event's
|
||||
* object in the target VM.
|
||||
*/
|
||||
public ObjectReference getObject() {
|
||||
return ((WatchpointEvent)oneEvent).object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Current value of the field.
|
||||
*/
|
||||
public Value getValueCurrent() {
|
||||
return ((WatchpointEvent)oneEvent).valueCurrent();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user