diff options
Diffstat (limited to 'libjava/classpath/gnu/classpath/jdwp')
17 files changed, 120 insertions, 21 deletions
diff --git a/libjava/classpath/gnu/classpath/jdwp/event/VmDeathEvent.java b/libjava/classpath/gnu/classpath/jdwp/event/VmDeathEvent.java new file mode 100644 index 00000000000..b0d9b656562 --- /dev/null +++ b/libjava/classpath/gnu/classpath/jdwp/event/VmDeathEvent.java @@ -0,0 +1,85 @@ +/* VmDeathEvent.java -- An event specifying that the VM has terminated + Copyright (C) 2005 Free Software Foundation + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.classpath.jdwp.event; + +import gnu.classpath.jdwp.JdwpConstants; + +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * Event notifying the debugger that the virtual machine has terminated. + * + * @author Keith Seitz (keiths@redhat.com) + */ +public class VmDeathEvent + extends Event +{ + /** + * Constructs a <code>VmDeathEvent</code> object + * + * @param thread the initial thread + */ + public VmDeathEvent () + { + super (JdwpConstants.EventKind.VM_DEATH); + } + + /** + * Returns a specific filtering parameter for this event. + * This event has no valid types. + * + * @param type the type of parameter desired + * @returns the desired parameter or <code>null</code> + */ + public Object getParameter (Class type) + { + return null; + } + + /** + * Writes out event-specific data + */ + protected void _writeData (DataOutputStream outStream) + throws IOException + { + // no data (request ID done by VMIdManager) + } +} diff --git a/libjava/classpath/gnu/classpath/jdwp/event/filters/StepFilter.java b/libjava/classpath/gnu/classpath/jdwp/event/filters/StepFilter.java index 75753cda095..d029e61e10d 100644 --- a/libjava/classpath/gnu/classpath/jdwp/event/filters/StepFilter.java +++ b/libjava/classpath/gnu/classpath/jdwp/event/filters/StepFilter.java @@ -66,7 +66,7 @@ public class StepFilter public StepFilter (ThreadId tid, int size, int depth) throws InvalidThreadException { - if (tid == null | tid.getReference().get () == null) + if (tid.getReference().get () == null) throw new InvalidThreadException (tid.getId ()); _tid = tid; diff --git a/libjava/classpath/gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.java b/libjava/classpath/gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.java index 039b4372125..83ad4094660 100644 --- a/libjava/classpath/gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.java +++ b/libjava/classpath/gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.java @@ -66,7 +66,7 @@ public class ThreadOnlyFilter public ThreadOnlyFilter (ThreadId tid) throws InvalidThreadException { - if (tid == null | tid.getReference().get () == null) + if (tid.getReference().get () == null) throw new InvalidThreadException (tid.getId ()); _tid = tid; diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.java index 24702166252..a9dc6cc815f 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.java @@ -88,7 +88,8 @@ public class ArrayReferenceCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeLength(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ArrayTypeCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ArrayTypeCommandSet.java index 8ae1b450862..b77c3a833a2 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ArrayTypeCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ArrayTypeCommandSet.java @@ -82,7 +82,8 @@ public class ArrayTypeCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } public void executeNewInstance(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java index 4e8e23ede23..cc591b17dd1 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java @@ -86,7 +86,8 @@ public class ClassLoaderReferenceCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } public void executeVisibleClasses(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.java index dcafa6f84d2..cfec20bc7ce 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.java @@ -79,7 +79,8 @@ public class ClassObjectReferenceCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } public void executeReflectedType(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ClassTypeCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ClassTypeCommandSet.java index ff6010e59cb..f60da7b7021 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ClassTypeCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ClassTypeCommandSet.java @@ -95,7 +95,8 @@ public class ClassTypeCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeSuperclass(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/EventRequestCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/EventRequestCommandSet.java index 389b2d349f9..e4b1b602ef5 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/EventRequestCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/EventRequestCommandSet.java @@ -102,7 +102,8 @@ public class EventRequestCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeSet(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/MethodCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/MethodCommandSet.java index b5db664e4e4..53308d7c11b 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/MethodCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/MethodCommandSet.java @@ -94,7 +94,8 @@ public class MethodCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeLineTable(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java index 23a64c341e6..ef421ea5b28 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java @@ -106,7 +106,8 @@ public class ObjectReferenceCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeReferenceType(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java index b9944f7d9a0..7338480fcab 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java @@ -128,7 +128,8 @@ public class ReferenceTypeCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeSignature(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/StackFrameCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/StackFrameCommandSet.java index 480f4ca2833..7890a8e4b1b 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/StackFrameCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/StackFrameCommandSet.java @@ -91,7 +91,8 @@ public class StackFrameCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeGetValues(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/StringReferenceCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/StringReferenceCommandSet.java index 8f5bc685cda..13fde0ac732 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/StringReferenceCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/StringReferenceCommandSet.java @@ -84,7 +84,8 @@ public class StringReferenceCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeValue(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.java index 8a11195a708..ba36251f665 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.java @@ -85,7 +85,8 @@ public class ThreadGroupReferenceCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeName(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java index 73643b6a83a..559e405b65a 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java @@ -118,7 +118,8 @@ public class ThreadReferenceCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return true; + + return false; } private void executeName(ByteBuffer bb, DataOutputStream os) diff --git a/libjava/classpath/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java b/libjava/classpath/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java index b83406873e3..6bdb236818c 100644 --- a/libjava/classpath/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java +++ b/libjava/classpath/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java @@ -67,7 +67,7 @@ public class VirtualMachineCommandSet public boolean runCommand(ByteBuffer bb, DataOutputStream os, byte command) throws JdwpException { - boolean keepRunning = true; + boolean shutdown = false; try { switch (command) @@ -91,7 +91,7 @@ public class VirtualMachineCommandSet executeIDsizes(bb, os); break; case JdwpConstants.CommandSet.VirtualMachine.DISPOSE: - keepRunning = false; + shutdown = true; executeDispose(bb, os); break; case JdwpConstants.CommandSet.VirtualMachine.SUSPEND: @@ -101,7 +101,7 @@ public class VirtualMachineCommandSet executeResume(bb, os); break; case JdwpConstants.CommandSet.VirtualMachine.EXIT: - keepRunning = false; + shutdown = true; executeExit(bb, os); break; case JdwpConstants.CommandSet.VirtualMachine.CREATE_STRING: @@ -145,7 +145,8 @@ public class VirtualMachineCommandSet // So if we throw an IOException we're in serious trouble throw new JdwpInternalErrorException(ex); } - return keepRunning; + + return shutdown; } private void executeVersion(ByteBuffer bb, DataOutputStream os) @@ -164,8 +165,8 @@ public class VirtualMachineCommandSet String vmVersion = props.getProperty("java.version"); String vmName = props.getProperty("java.vm.name"); JdwpString.writeString(os, description); - os.write(jdwpMajor); - os.write(jdwpMinor); + os.writeInt(jdwpMajor); + os.writeInt(jdwpMinor); JdwpString.writeString(os, vmName); JdwpString.writeString(os, vmVersion); } |